Class: Trumail::Parser::Xml
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#parse ⇒ Object
rubocop:disable Security/Eval.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Trumail::Parser::Base
Instance Method Details
#parse ⇒ Object
rubocop:disable Security/Eval
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/trumail/parser/xml.rb', line 10 def parse @hash = Ox.load(@data, mode: :hash_no_attrs) .dig(:lookup) .each_with_object({}) do |(key, val), hash| hash[key.to_s] = begin eval(val) rescue StandardError, SyntaxError val end end end |