Class: Moxml::C14n::Nodes::TextNode

Inherits:
Moxml::C14n::Node show all
Defined in:
lib/moxml/c14n/nodes/text_node.rb

Overview

Text node. Stores the decoded value (entity refs resolved).

Instance Attribute Summary collapse

Attributes inherited from Moxml::C14n::Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Moxml::C14n::Node

#add_child, #in_node_set=, #in_node_set?

Constructor Details

#initialize(value:) ⇒ TextNode

Returns a new instance of TextNode.



10
11
12
13
# File 'lib/moxml/c14n/nodes/text_node.rb', line 10

def initialize(value:)
  super()
  @value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/moxml/c14n/nodes/text_node.rb', line 8

def value
  @value
end

Instance Method Details

#nameObject



15
16
17
# File 'lib/moxml/c14n/nodes/text_node.rb', line 15

def name
  "#text"
end

#node_typeObject



19
20
21
# File 'lib/moxml/c14n/nodes/text_node.rb', line 19

def node_type
  :text
end

#text_contentObject



23
24
25
# File 'lib/moxml/c14n/nodes/text_node.rb', line 23

def text_content
  @value
end