Class: Moxml::Adapter::CustomizedOga::XmlDeclaration
- Inherits:
-
Oga::XML::XmlDeclaration
- Object
- Oga::XML::XmlDeclaration
- Moxml::Adapter::CustomizedOga::XmlDeclaration
- Defined in:
- lib/moxml/adapter/customized_oga/xml_declaration.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ XmlDeclaration
constructor
A new instance of XmlDeclaration.
- #to_xml ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ XmlDeclaration
Returns a new instance of XmlDeclaration.
9 10 11 12 13 |
# File 'lib/moxml/adapter/customized_oga/xml_declaration.rb', line 9 def initialize( = {}) @version = [:version] || "1.0" @encoding = [:encoding] @standalone = [:standalone] end |
Instance Method Details
#to_xml ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/moxml/adapter/customized_oga/xml_declaration.rb', line 15 def to_xml parts = ["<?xml"] parts << %( version="#{version}") if version parts << %( encoding="#{encoding}") if encoding parts << %( standalone="#{standalone}") if standalone "#{parts.join}?>" end |