Class: SXRB::TextNode
Overview
Class representing special case of DOM nodes which contain only text, and don’t represent any particular element.
Instance Attribute Summary
Attributes inherited from Node
#attributes, #children, #name, #namespaces, #parent, #prefix, #uri
Instance Method Summary collapse
- #append_text(text) ⇒ Object private
-
#initialize(text) ⇒ TextNode
constructor
private
A new instance of TextNode.
-
#text ⇒ String
Accessor for text data kept in TextNode object.
Methods inherited from Node
Constructor Details
#initialize(text) ⇒ TextNode
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TextNode.
6 7 8 |
# File 'lib/sxrb/text_node.rb', line 6 def initialize(text) @text = text || "" end |
Instance Method Details
#append_text(text) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/sxrb/text_node.rb', line 11 def append_text(text) @text << text end |
#text ⇒ String
Accessor for text data kept in TextNode object.
17 18 19 |
# File 'lib/sxrb/text_node.rb', line 17 def text @text end |