Sha256: cf8b9e36223c825aa000720d390f11664afb4201f2cc2e89ee0740c10a44db66
Contents?: true
Size: 444 Bytes
Versions: 6
Compression:
Stored size: 444 Bytes
Contents
module Daigaku class Chapter attr_reader :title, :path def initialize(path) @path = path @title = File.basename(path).gsub(/\_+/, ' ') end def units @units ||= Loading::Units.load(@path) end def started? units.reduce(false) { |started, unit| started ||= unit.mastered? } end def mastered? units.reduce(true) { |mastered, unit| mastered &&= unit.mastered? } end end end
Version data entries
6 entries across 6 versions & 1 rubygems