Class: Spreadsheet::BuilderXmlBuilder
- Inherits:
-
Object
- Object
- Spreadsheet::BuilderXmlBuilder
- Defined in:
- lib/spreadsheet/builder_xml_builder.rb
Instance Method Summary collapse
- #import!(builder) ⇒ Object
-
#initialize ⇒ BuilderXmlBuilder
constructor
A new instance of BuilderXmlBuilder.
- #tag!(name, attrs = {}, content = nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ BuilderXmlBuilder
Returns a new instance of BuilderXmlBuilder.
5 6 7 |
# File 'lib/spreadsheet/builder_xml_builder.rb', line 5 def initialize @xml = ::Builder::XmlMarkup.new end |
Instance Method Details
#import!(builder) ⇒ Object
16 17 18 |
# File 'lib/spreadsheet/builder_xml_builder.rb', line 16 def import!(builder) @xml << builder.to_s end |
#tag!(name, attrs = {}, content = nil) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/spreadsheet/builder_xml_builder.rb', line 9 def tag!(name, attrs={}, content=nil) @xml.tag!(name, attrs) do @xml.text!(content) if content yield if block_given? end end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/spreadsheet/builder_xml_builder.rb', line 20 def to_s @xml.to_s end |