Class: Moxml::Adapter::Libxml::DoctypeWrapper

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

Overview

Wrapper class to store DOCTYPE information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc, name, external_id, system_id) ⇒ DoctypeWrapper

Returns a new instance of DoctypeWrapper.



22
23
24
25
26
27
# File 'lib/moxml/adapter/libxml.rb', line 22

def initialize(doc, name, external_id, system_id)
  @native_doc = doc
  @name = name
  @external_id = external_id
  @system_id = system_id
end

Instance Attribute Details

#external_idObject

Returns the value of attribute external_id.



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

def external_id
  @external_id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#native_docObject (readonly)

Returns the value of attribute native_doc.



19
20
21
# File 'lib/moxml/adapter/libxml.rb', line 19

def native_doc
  @native_doc
end

#system_idObject

Returns the value of attribute system_id.



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

def system_id
  @system_id
end

Instance Method Details

#nativeObject

Provide native method to match adapter pattern



30
31
32
# File 'lib/moxml/adapter/libxml.rb', line 30

def native
  @native_doc
end

#to_xmlObject



34
35
36
# File 'lib/moxml/adapter/libxml.rb', line 34

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