Class: 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
Methods inherited from Model
Constructor Details
#initialize ⇒ Chapter
Returns a new instance of Chapter.
6 7 8 9 10 |
# File 'lib/epubber/models/chapter.rb', line 6 def initialize @id = 0 @title = 'Not specified' @content = '<p>Not specified</p>' end |
Instance Method Details
#content(text) ⇒ Object
20 21 22 |
# File 'lib/epubber/models/chapter.rb', line 20 def content(text) @content = clean_html(text) end |
#contextify ⇒ Object
24 25 26 |
# File 'lib/epubber/models/chapter.rb', line 24 def contextify { 'id' => @id, 'title' => @title, 'content' => @content } end |
#id(idx) ⇒ Object
12 13 14 |
# File 'lib/epubber/models/chapter.rb', line 12 def id(idx) @id = idx end |
#title(text) ⇒ Object
16 17 18 |
# File 'lib/epubber/models/chapter.rb', line 16 def title(text) @title = text end |