Sha256: 72254ed8f71cc1bad52ba57750c55cc7a9c0ed82e76b015a962221d642688557
Contents?: true
Size: 631 Bytes
Versions: 1
Compression:
Stored size: 631 Bytes
Contents
module Daigaku class Course attr_reader :title, :path, :author, :link def initialize(path) @path = path @title = File.basename(path).gsub(/\_+/, ' ') @author = QuickStore.store.get(key(:author)) end def chapters @chapters ||= Loading::Chapters.load(@path) end def started? chapters.reduce(false) { |started, chapter| started ||= chapter.started? } end def mastered? chapters.reduce(true) { |mastered, chapter| mastered &&= chapter.mastered? } end def key(key_name) Storeable.key(title, prefix: 'courses', suffix: key_name) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
daigaku-0.1.0 | lib/daigaku/course.rb |