Sha256: 7af6fe6bfa44ce0d41b6d70032897fc148b4ad39df368afb6c13e4fd2630c61d
Contents?: true
Size: 726 Bytes
Versions: 14
Compression:
Stored size: 726 Bytes
Contents
# encoding: utf-8 module Laximo module Respond class FindOem < Laximo::Respond::Base def parsing_result(str) str.xpath('//FindOEM/detail').inject([]) { |arr, node| h = node_to_hash(node) h[:images] = nodes_to_hash(node.xpath('./images/image')) h[:properties] = nodes_to_hash(node.xpath('./properties/property')) h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1| h1 = node_to_hash(n1) h2 = node_to_hash(n1.children[0]) h1.merge!(h2) arr1 << h1 } arr << h } end # parsing_result end # FindOem end # Respond end # Laximo
Version data entries
14 entries across 14 versions & 1 rubygems