Class: Bookery::Book
- Inherits:
-
Object
- Object
- Bookery::Book
- Defined in:
- lib/bookery/book.rb
Instance Attribute Summary collapse
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
Instance Method Summary collapse
- #chapters ⇒ Object
-
#initialize(lang, options = {}) ⇒ Book
constructor
A new instance of Book.
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, = {}) @lang = lang @cwd = [:cwd] || '' end |
Instance Attribute Details
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def lang @lang end |
Instance Method Details
#chapters ⇒ Object
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 |