class Daigaku::Chapter

Attributes

path[R]
title[R]

Public Class Methods

new(path) click to toggle source
# File lib/daigaku/chapter.rb, line 5
def initialize(path)
  @path  = path
  @title = File.basename(path).gsub(/\_+/, ' ')
end

Public Instance Methods

mastered?() click to toggle source
# File lib/daigaku/chapter.rb, line 18
def mastered?
  units.all?(&:mastered?)
end
started?() click to toggle source
# File lib/daigaku/chapter.rb, line 14
def started?
  units.any?(&:mastered?)
end
units() click to toggle source
# File lib/daigaku/chapter.rb, line 10
def units
  @units ||= Loading::Units.load(@path)
end