Class: Rpub::XmlFile
- Inherits:
-
Object
- Object
- Rpub::XmlFile
- Defined in:
- lib/rpub/xml_file.rb
Direct Known Subclasses
Epub::Container, Epub::Content, Epub::Cover, Epub::HtmlToc, Epub::Toc
Instance Attribute Summary collapse
-
#book ⇒ Object
readonly
Returns the value of attribute book.
- #xml ⇒ Builder::XmlMarkup readonly
Instance Method Summary collapse
-
#initialize(book = nil) ⇒ XmlFile
constructor
A new instance of XmlFile.
-
#to_s ⇒ String
Render this file and output as string.
Constructor Details
permalink #initialize(book = nil) ⇒ XmlFile
Returns a new instance of XmlFile.
8 9 10 11 |
# File 'lib/rpub/xml_file.rb', line 8 def initialize(book = nil) @xml = Builder::XmlMarkup.new :indent => 2 @book = book end |
Instance Attribute Details
permalink #book ⇒ Object (readonly)
Returns the value of attribute book.
6 7 8 |
# File 'lib/rpub/xml_file.rb', line 6 def book @book end |
permalink #xml ⇒ Builder::XmlMarkup (readonly)
4 5 6 |
# File 'lib/rpub/xml_file.rb', line 4 def xml @xml end |
Instance Method Details
permalink #to_s ⇒ String
Returns render this file and output as string.
14 15 16 17 |
# File 'lib/rpub/xml_file.rb', line 14 def to_s render xml.target! end |