Class: Moxml::Adapter::CustomizedLeptris::Doctype
- Inherits:
-
Object
- Object
- Moxml::Adapter::CustomizedLeptris::Doctype
- Defined in:
- lib/moxml/adapter/customized_leptris/doctype.rb
Overview
Wrapper for a programmatic DOCTYPE. libleptris only parses DOCTYPEs from source; it has no API to create one, so Moxml stores this value object in the document's attachments.
Instance Attribute Summary collapse
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent_doc ⇒ Object
Returns the value of attribute parent_doc.
-
#system_id ⇒ Object
Returns the value of attribute system_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, external_id = nil, system_id = nil) ⇒ Doctype
constructor
A new instance of Doctype.
- #to_xml ⇒ Object
Constructor Details
#initialize(name, external_id = nil, system_id = nil) ⇒ Doctype
Returns a new instance of Doctype.
12 13 14 15 16 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 12 def initialize(name, external_id = nil, system_id = nil) @name = name @external_id = external_id @system_id = system_id end |
Instance Attribute Details
#external_id ⇒ Object
Returns the value of attribute external_id.
10 11 12 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 10 def external_id @external_id end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 10 def name @name end |
#parent_doc ⇒ Object
Returns the value of attribute parent_doc.
10 11 12 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 10 def parent_doc @parent_doc end |
#system_id ⇒ Object
Returns the value of attribute system_id.
10 11 12 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 10 def system_id @system_id end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 22 def ==(other) other.is_a?(self.class) && name == other.name && external_id == other.external_id && system_id == other.system_id end |
#to_xml ⇒ Object
18 19 20 |
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 18 def to_xml XmlEmitter.doctype_xml(name, external_id, system_id) end |