Class: NodeValue
- Inherits:
-
Object
- Object
- NodeValue
- Defined in:
- lib/src/extractor.rb
Instance Method Summary collapse
-
#initialize(node) ⇒ NodeValue
constructor
A new instance of NodeValue.
- #raw_value ⇒ Object
Constructor Details
#initialize(node) ⇒ NodeValue
Returns a new instance of NodeValue.
119 120 121 |
# File 'lib/src/extractor.rb', line 119 def initialize(node) @node = node end |
Instance Method Details
#raw_value ⇒ Object
123 124 125 126 127 128 129 130 131 |
# File 'lib/src/extractor.rb', line 123 def raw_value return "" unless node node_size = node.try(:size).to_i return node.map(&:text) if node_size > 1 return node.first if node_size == 1 && contains_children? node.text end |