Class: Oga::XML::CharacterNode
- Defined in:
- lib/oga/xml/character_node.rb
Overview
Base class for nodes that represent a text-like value such as Text and Comment nodes.
Direct Known Subclasses
Instance Attribute Summary collapse
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CharacterNode
constructor
A new instance of CharacterNode.
-
#inspect ⇒ String
Methods inherited from Node
#after, #before, #children, #children=, #each_ancestor, #html?, #next_element, #parent, #previous_element, #remove, #replace, #root_node, #xml?
Methods included from ToXML
Methods included from Traversal
Constructor Details
#initialize(options = {}) ⇒ CharacterNode
Returns a new instance of CharacterNode
12 13 14 15 16 |
# File 'lib/oga/xml/character_node.rb', line 12 def initialize( = {}) super @text = [:text] end |
Instance Attribute Details
#text ⇒ String
7 8 9 |
# File 'lib/oga/xml/character_node.rb', line 7 def text @text end |
Instance Method Details
#inspect ⇒ String
19 20 21 |
# File 'lib/oga/xml/character_node.rb', line 19 def inspect "#{self.class.to_s.split('::').last}(#{text.inspect})" end |