Sha256: 6c18d52ccc28ff2b4a6ecc3499696eeaa51c7c39a99025fc97201f25aad1c5b7

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

require 'peddler/parsers/model'
require 'mws/sellers/parsers/marketplace'
require 'mws/sellers/parsers/participation'
require 'peddler/parsers/tokenable'

module MWS
  module Sellers
    module Parsers
      class MarketplaceParticipations < ::Peddler::Parsers::Model
        include ::Peddler::Parsers::Tokenable

        value(:marketplaces) do
          marketplace_nodes.map { |node| Marketplace.new(node) }
        end

        value(:participations) do
          participation_nodes.map { |node| Participation.new(node) }
        end

        private

        def participation_nodes
          xpath('ListParticipations/Participation')
        end

        def marketplace_nodes
          xpath('ListMarketplaces/Marketplace')
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peddler-0.6.5 lib/mws/sellers/parsers/marketplace_participations.rb
peddler-0.6.4 lib/mws/sellers/parsers/marketplace_participations.rb