Class: DarwinCore::XmlReader::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/dwc_archive/xml_reader.rb

Overview

Node is a helper class to parse xml into hash

Instance Method Summary collapse

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

#valueObject



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