Sha256: dbb1c70af1fd368455e12060b640ddca6bcb4a7988d26890d3959d44b84fd2f5

Contents?: true

Size: 796 Bytes

Versions: 10

Compression:

Stored size: 796 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?

        }

      end # parsing_result

    end # ListQuickDetail

  end # Respond

end # Laximo

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
laximo-0.7 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.5.1 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.5 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.4 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.3 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.2 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.1 lib/laximo/respond/list_quick_detail.rb
laximo-0.6.0 lib/laximo/respond/list_quick_detail.rb
laximo-0.5.2 lib/laximo/respond/list_quick_detail.rb
laximo-0.5.1 lib/laximo/respond/list_quick_detail.rb