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

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