Class: ImportEverything::XmlParser::LineParser

Inherits:
LineParser show all
Includes:
FromHash
Defined in:
lib/import_everything/parsers/xml_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LineParser

#row_hashes, #value_hashes

Instance Attribute Details

#docObject

Returns the value of attribute doc.



30
31
32
# File 'lib/import_everything/parsers/xml_parser.rb', line 30

def doc
  @doc
end

#tableObject

Returns the value of attribute table.



30
31
32
# File 'lib/import_everything/parsers/xml_parser.rb', line 30

def table
  @table
end

Instance Method Details

#value_hashObject



32
33
34
35
# File 'lib/import_everything/parsers/xml_parser.rb', line 32

def value_hash
  cs = doc.children.reject { |x| x.to_s.blank? }
  cs.inject({}) { |h,el| h.merge(el.name => el.inner_text) }
end