Class: Epubber::Models::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/epubber/models/chapter.rb

Instance Method Summary collapse

Constructor Details

#initializeChapter

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

#contextifyObject



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