Sha256: 6944d34b32855fdfe8eba081d330ec57528ef1f53b66faa28c5562d5fe6dce5a
Contents?: true
Size: 810 Bytes
Versions: 2
Compression:
Stored size: 810 Bytes
Contents
# encoding: utf-8 module Laximo module Respond class ListQuickDetail < Laximo::Respond::Base def parsing_result(str) str.xpath('//ListQuickDetail/Category').inject([]) { |arr, node| h = node_to_hash(node) { |h1, n1| h1[:unit] = n1.xpath('./Unit').inject([]) { |arr1, n2| arr1 << node_to_hash(n2) { |h2, n3| h2[:details] = n3.xpath('./Detail').inject([]) { |arr2, n4| arr2 << node_to_hash(n4) { |h3, n5| h3[:attributes] = nodes_to_hash(n5.xpath('./attribute')) } } } } } arr << h unless h.empty? arr } end # parsing_result end # ListQuickDetail end # Respond end # Laximo
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
laximo-0.8.1 | lib/laximo/respond/oem/list_quick_detail.rb |
laximo-0.8 | lib/laximo/respond/oem/list_quick_detail.rb |