Class: Bookery::Book
- Inherits:
-
Object
- Object
- Bookery::Book
- Defined in:
- lib/bookery/book.rb
Instance Attribute Summary collapse
-
#authors ⇒ Object
readonly
Returns the value of attribute authors.
-
#chapters ⇒ Object
readonly
Returns the value of attribute chapters.
-
#editors ⇒ Object
readonly
Returns the value of attribute editors.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(chapters, config) ⇒ Book
constructor
A new instance of Book.
Constructor Details
#initialize(chapters, config) ⇒ Book
Returns a new instance of Book.
6 7 8 9 10 11 12 13 |
# File 'lib/bookery/book.rb', line 6 def initialize(chapters, config) @title = config[:title] @authors = config[:authors] @editors = config[:editors] @language = config[:language] @template = config[:template] @chapters = chapters end |
Instance Attribute Details
#authors ⇒ Object (readonly)
Returns the value of attribute authors.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def @authors end |
#chapters ⇒ Object (readonly)
Returns the value of attribute chapters.
4 5 6 |
# File 'lib/bookery/book.rb', line 4 def chapters @chapters end |
#editors ⇒ Object (readonly)
Returns the value of attribute editors.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def editors @editors end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def language @language end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def template @template end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/bookery/book.rb', line 3 def title @title end |
Instance Method Details
#content ⇒ Object
15 16 17 18 19 |
# File 'lib/bookery/book.rb', line 15 def content chapters.inject('') do |content, chapter| content << chapter.content end end |