Sha256: 9305efcd5a19ab3e552a1dc2c3a19b5ebbb56d0b6149af93ec78a950d89b4c1e

Contents?: true

Size: 667 Bytes

Versions: 3

Compression:

Stored size: 667 Bytes

Contents

module Economic
  class PricingRepo < Economic::ProductRepo
    def self.currency_specific_sales_prices_for(product_or_product_number)
      id = product_or_product_number.product_number if product_or_product_number.respond_to? :product_number
      id ||= product_or_product_number

      end_point = [superclass.endpoint_url, id, 'pricing', 'currency-specific-sales-prices'].join('/')
      response = test_response(RestClient.get(URI.escape(end_point), headers))
      entry_hash = JSON.parse(response.body)
      pricings = []

      entry_hash['collection'].each do |pricing|
        pricings.push Pricing.new(pricing)
      end
      pricings
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
economic-rest-0.3.4 lib/economic/pricing_repo.rb
economic-rest-0.3.3 lib/economic/pricing_repo.rb
economic-rest-0.3.2 lib/economic/pricing_repo.rb