Class: Epubber::Models::Chapter
- Inherits:
-
Object
- Object
- Epubber::Models::Chapter
- Defined in:
- lib/epubber/models/chapter.rb
Instance Method Summary collapse
- #content(text) ⇒ Object
- #contextify ⇒ Object
- #id(idx) ⇒ Object
-
#initialize ⇒ Chapter
constructor
A new instance of Chapter.
- #title(text) ⇒ Object
Constructor Details
#initialize ⇒ Chapter
Returns a new instance of Chapter.
4 5 6 7 8 |
# File 'lib/epubber/models/chapter.rb', line 4 def initialize @id = 0 @title = 'Not specified' @content = '<p>Not specified</p>' end |
Instance Method Details
#content(text) ⇒ Object
18 19 20 |
# File 'lib/epubber/models/chapter.rb', line 18 def content(text) @content = text end |
#contextify ⇒ Object
22 23 24 |
# File 'lib/epubber/models/chapter.rb', line 22 def contextify { 'id' => @id, 'title' => @title, 'content' => @content } end |
#id(idx) ⇒ Object
10 11 12 |
# File 'lib/epubber/models/chapter.rb', line 10 def id(idx) @id = idx end |
#title(text) ⇒ Object
14 15 16 |
# File 'lib/epubber/models/chapter.rb', line 14 def title(text) @title = text end |