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

Version Path
laximo-0.8.1 lib/laximo/respond/am/find_oem.rb
laximo-0.8 lib/laximo/respond/am/find_oem.rb
laximo-0.7 lib/laximo/respond/find_oem.rb
laximo-0.6.5.1 lib/laximo/respond/find_oem.rb
laximo-0.6.5 lib/laximo/respond/find_oem.rb
laximo-0.6.4 lib/laximo/respond/find_oem.rb
laximo-0.6.3 lib/laximo/respond/find_oem.rb
laximo-0.6.2 lib/laximo/respond/find_oem.rb
laximo-0.6.1 lib/laximo/respond/find_oem.rb
laximo-0.6.0 lib/laximo/respond/find_oem.rb
laximo-0.5.2 lib/laximo/respond/find_oem.rb
laximo-0.5.1 lib/laximo/respond/find_oem.rb
laximo-0.5.0 lib/laximo/respond/find_oem.rb
laximo-0.4.2 lib/laximo/respond/find_oem.rb