Class: Thepub::Epub::NCX::NavPoint
- Inherits:
-
Struct
- Object
- Struct
- Thepub::Epub::NCX::NavPoint
- Defined in:
- lib/thepub/epub/ncx.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#play_order ⇒ Object
Returns the value of attribute play_order.
-
#points ⇒ Object
Returns the value of attribute points.
-
#src ⇒ Object
Returns the value of attribute src.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, src, points = nil) ⇒ NavPoint
constructor
A new instance of NavPoint.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(title, src, points = nil) ⇒ NavPoint
Returns a new instance of NavPoint.
81 82 83 84 85 |
# File 'lib/thepub/epub/ncx.rb', line 81 def initialize(title, src, points = nil) super(title, src) @play_order = 0 @points = points || [] end |
Instance Attribute Details
#play_order ⇒ Object
Returns the value of attribute play_order.
87 88 89 |
# File 'lib/thepub/epub/ncx.rb', line 87 def play_order @play_order end |
#points ⇒ Object
Returns the value of attribute points.
88 89 90 |
# File 'lib/thepub/epub/ncx.rb', line 88 def points @points end |
#src ⇒ Object
Returns the value of attribute src
76 77 78 |
# File 'lib/thepub/epub/ncx.rb', line 76 def src @src end |
#title ⇒ Object
Returns the value of attribute title
76 77 78 |
# File 'lib/thepub/epub/ncx.rb', line 76 def title @title end |
Instance Method Details
#to_xml(builder) ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/thepub/epub/ncx.rb', line 90 def to_xml(builder) builder.navPoint :id => point_id(@play_order), :playOrder => @play_order do builder.navLabel do builder.text self.title end builder.content :src => self.src @points.each { |point| point.to_xml(builder) } end end |