Class: Moxml::Adapter::CustomizedLeptris::Doctype

Inherits:
Object
  • Object
show all
Defined in:
lib/moxml/adapter/customized_leptris/doctype.rb

Overview

Wrapper for a programmatic DOCTYPE. libleptris can create one (Document#set_doctype, 1.9.176 / #212) but cannot unset it, and the facade contract makes DOCTYPEs removable nodes — so Moxml keeps this value object as the lifecycle record in the document's attachments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, external_id = nil, system_id = nil) ⇒ Doctype

Returns a new instance of Doctype.



14
15
16
17
18
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 14

def initialize(name, external_id = nil, system_id = nil)
  @name = name
  @external_id = external_id
  @system_id = system_id
end

Instance Attribute Details

#external_idObject

Returns the value of attribute external_id.



12
13
14
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 12

def external_id
  @external_id
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 12

def name
  @name
end

#parent_docObject

Returns the value of attribute parent_doc.



12
13
14
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 12

def parent_doc
  @parent_doc
end

#system_idObject

Returns the value of attribute system_id.



12
13
14
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 12

def system_id
  @system_id
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
27
28
29
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 24

def ==(other)
  other.is_a?(self.class) &&
    name == other.name &&
    external_id == other.external_id &&
    system_id == other.system_id
end

#to_xmlObject



20
21
22
# File 'lib/moxml/adapter/customized_leptris/doctype.rb', line 20

def to_xml
  XmlEmitter.doctype_xml(name, external_id, system_id)
end