Sha256: 565a7323f47f0993ffc18279e4096b2c36d299d02172b1d432dc4928e93e25b1
Contents?: true
Size: 756 Bytes
Versions: 15
Compression:
Stored size: 756 Bytes
Contents
# encoding: utf-8 module Laximo module Respond class FindOemCorrection < Laximo::Respond::Base def parsing_result(str) str.xpath('//FindOEMCorrection/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 # FindOemCorrection end # Respond end # Laximo
Version data entries
15 entries across 15 versions & 1 rubygems