Class: EPUB::Publication::Package::Spine
- Inherits:
-
Object
- Object
- EPUB::Publication::Package::Spine
- Includes:
- ContentModel
- Defined in:
- lib/epub/maker/publication.rb
Instance Method Summary collapse
- #make {|_self| ... } ⇒ Object
- #make_itemref {|itemref| ... } ⇒ Object
- #to_xml_fragment(xml) ⇒ Object
Methods included from ContentModel
Instance Method Details
#make {|_self| ... } ⇒ Object
351 352 353 354 |
# File 'lib/epub/maker/publication.rb', line 351 def make yield self if block_given? self end |
#make_itemref {|itemref| ... } ⇒ Object
356 357 358 359 360 361 |
# File 'lib/epub/maker/publication.rb', line 356 def make_itemref itemref = Itemref.new self << itemref yield itemref if block_given? itemref end |
#to_xml_fragment(xml) ⇒ Object
363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/epub/maker/publication.rb', line 363 def to_xml_fragment(xml) node = xml.spine_ { itemrefs.each do |itemref| itemref_node = xml.itemref to_xml_attribute itemref_node, itemref, [:idref, :id] itemref_node['linear'] = 'no' unless itemref.linear? itemref_node['properties'] = itemref.properties.to_a.join(' ') unless itemref.properties.empty? end } to_xml_attribute node, self, [:id, :toc, :page_progression_direction] end |