Class: XmlUtils::DocType
- Defined in:
- lib/xmlutils/node.rb
Instance Attribute Summary collapse
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#public_id ⇒ Object
Returns the value of attribute public_id.
-
#system_id ⇒ Object
Returns the value of attribute system_id.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(name, external_id = nil, system_id = nil, public_id = nil, parent = nil) ⇒ DocType
constructor
A new instance of DocType.
- #node_type ⇒ Object
- #write_content(output, indent = 0) ⇒ Object
Methods inherited from ChildNode
Methods inherited from Node
#deep_clone, #document, #each, #next_sibling, #previous_sibling, #remove, #root, #to_s
Constructor Details
#initialize(name, external_id = nil, system_id = nil, public_id = nil, parent = nil) ⇒ DocType
Returns a new instance of DocType.
253 254 255 256 257 258 259 260 |
# File 'lib/xmlutils/node.rb', line 253 def initialize(name, external_id = nil, system_id = nil, public_id = nil, parent = nil) super() @parent = parent @name = name @external_id = external_id @system_id = system_id @public_id = public_id end |
Instance Attribute Details
#external_id ⇒ Object
Returns the value of attribute external_id.
251 252 253 |
# File 'lib/xmlutils/node.rb', line 251 def external_id @external_id end |
#name ⇒ Object
Returns the value of attribute name.
251 252 253 |
# File 'lib/xmlutils/node.rb', line 251 def name @name end |
#public_id ⇒ Object
Returns the value of attribute public_id.
251 252 253 |
# File 'lib/xmlutils/node.rb', line 251 def public_id @public_id end |
#system_id ⇒ Object
Returns the value of attribute system_id.
251 252 253 |
# File 'lib/xmlutils/node.rb', line 251 def system_id @system_id end |
Instance Method Details
#node_type ⇒ Object
262 263 264 |
# File 'lib/xmlutils/node.rb', line 262 def node_type :doctype end |
#write_content(output, indent = 0) ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/xmlutils/node.rb', line 266 def write_content(output, indent = 0) if @external_id if @public_id output << "<!DOCTYPE #{@name} PUBLIC \"#{@public_id}\" \"#{@system_id}\">" else output << "<!DOCTYPE #{@name} SYSTEM \"#{@system_id}\">" end else output << "<!DOCTYPE #{@name}>" end end |