Class: XmlUtils::Comment
- Defined in:
- lib/xmlutils/node.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
Attributes inherited from Node
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(string, parent = nil) ⇒ Comment
constructor
A new instance of Comment.
- #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(string, parent = nil) ⇒ Comment
Returns a new instance of Comment.
204 205 206 207 208 |
# File 'lib/xmlutils/node.rb', line 204 def initialize(string, parent = nil) super() @parent = parent @string = string.to_s end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
202 203 204 |
# File 'lib/xmlutils/node.rb', line 202 def string @string end |
Instance Method Details
#clone ⇒ Object
214 215 216 |
# File 'lib/xmlutils/node.rb', line 214 def clone Comment.new(@string) end |
#node_type ⇒ Object
210 211 212 |
# File 'lib/xmlutils/node.rb', line 210 def node_type :comment end |
#write_content(output, indent = 0) ⇒ Object
218 219 220 |
# File 'lib/xmlutils/node.rb', line 218 def write_content(output, indent = 0) output << "<!--#{@string}-->" end |