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)
-
- (Object) book
readonly
Returns the value of attribute book.
-
- (Builder::XmlMarkup) xml
readonly
Instance Method Summary (collapse)
-
- (XmlFile) initialize(book = nil)
constructor
A new instance of XmlFile.
-
- (String) to_s
Render this file and output as string.
Constructor Details
- (XmlFile) initialize(book = nil)
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
- (Object) book (readonly)
Returns the value of attribute book
6 7 8 |
# File 'lib/rpub/xml_file.rb', line 6 def book @book end |
- (Builder::XmlMarkup) xml (readonly)
4 5 6 |
# File 'lib/rpub/xml_file.rb', line 4 def xml @xml end |
Instance Method Details
- (String) to_s
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 |