Class: Bookery::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/bookery/book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lang, options = {}) ⇒ Book

Returns a new instance of Book.



5
6
7
8
# File 'lib/bookery/book.rb', line 5

def initialize(lang, options = {})
  @lang = lang
  @cwd = options[:cwd] || ''
end

Instance Attribute Details

#langObject (readonly)

Returns the value of attribute lang.



3
4
5
# File 'lib/bookery/book.rb', line 3

def lang
  @lang
end

Instance Method Details

#chaptersObject



10
11
12
13
14
# File 'lib/bookery/book.rb', line 10

def chapters
  @chapters ||= Dir.entries(book_dir).collect do |entry|
    Chapter.new(entry) if entry.size > 2
  end.compact
end