Class: Trumail::Parser::Xml

Inherits:
Base
  • Object
show all
Defined in:
lib/trumail/parser/xml.rb

Instance Attribute Summary

Attributes inherited from Base

#hash

Instance Method Summary collapse

Methods inherited from Base

#initialize, parse

Constructor Details

This class inherits a constructor from Trumail::Parser::Base

Instance Method Details

#parseObject



9
10
11
12
13
14
# File 'lib/trumail/parser/xml.rb', line 9

def parse
  @hash = Ox.parse(@data).nodes.each_with_object({}) do |xml, memo|
    value = xml.nodes.first
    memo[xml.value] = eval(value) rescue value
  end
end