Class: Moxml::Adapter::CustomizedLeptris::Declaration
- Inherits:
-
Object
- Object
- Moxml::Adapter::CustomizedLeptris::Declaration
- Defined in:
- lib/moxml/adapter/customized_leptris/declaration.rb
Overview
Wrapper for an XML declaration. libleptris stores declaration data on the document struct (read-only, serialized via options) and has no first-class declaration node, so Moxml exposes this mutable value object instead.
Instance Attribute Summary collapse
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#parent_doc ⇒ Object
Returns the value of attribute parent_doc.
-
#standalone ⇒ Object
Returns the value of attribute standalone.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(version = "1.0", encoding = "UTF-8", standalone = nil) ⇒ Declaration
constructor
A new instance of Declaration.
- #to_xml ⇒ Object
Constructor Details
#initialize(version = "1.0", encoding = "UTF-8", standalone = nil) ⇒ Declaration
Returns a new instance of Declaration.
13 14 15 16 17 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 13 def initialize(version = "1.0", encoding = "UTF-8", standalone = nil) @version = version @encoding = encoding @standalone = standalone end |
Instance Attribute Details
#encoding ⇒ Object
Returns the value of attribute encoding.
11 12 13 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 11 def encoding @encoding end |
#parent_doc ⇒ Object
Returns the value of attribute parent_doc.
11 12 13 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 11 def parent_doc @parent_doc end |
#standalone ⇒ Object
Returns the value of attribute standalone.
11 12 13 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 11 def standalone @standalone end |
#version ⇒ Object
Returns the value of attribute version.
11 12 13 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 11 def version @version end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 23 def ==(other) other.is_a?(self.class) && version == other.version && encoding == other.encoding && standalone == other.standalone end |
#to_xml ⇒ Object
19 20 21 |
# File 'lib/moxml/adapter/customized_leptris/declaration.rb', line 19 def to_xml XmlEmitter.declaration_xml(version, encoding, standalone) end |