Class: DarwinCore::XmlReader::Node
- Inherits:
-
Object
- Object
- DarwinCore::XmlReader::Node
- Defined in:
- lib/dwc_archive/xml_reader.rb
Overview
Node is a helper class to parse xml into hash
Instance Method Summary collapse
-
#initialize(node) ⇒ Node
constructor
A new instance of Node.
- #value ⇒ Object
Constructor Details
#initialize(node) ⇒ Node
Returns a new instance of Node.
16 17 18 19 |
# File 'lib/dwc_archive/xml_reader.rb', line 16 def initialize(node) @node = node @val = {} end |
Instance Method Details
#value ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/dwc_archive/xml_reader.rb', line 21 def value if @node.element? prepare_node_element else prepare(@node.content.to_s) end end |