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(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

#authorsObject (readonly)

Returns the value of attribute authors.



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

def authors
  @authors
end

#chaptersObject (readonly)

Returns the value of attribute chapters.



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

def chapters
  @chapters
end

#editorsObject (readonly)

Returns the value of attribute editors.



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

def editors
  @editors
end

#languageObject (readonly)

Returns the value of attribute language.



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

def language
  @language
end

#templateObject (readonly)

Returns the value of attribute template.



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

def template
  @template
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#contentObject



15
16
17
18
19
# File 'lib/bookery/book.rb', line 15

def content
  chapters.inject('') do |content, chapter|
    content << chapter.content
  end
end