Sha256: df39d3932b4bd29bfde6e97cdc2c50d61bce92b94edb3ff4487aef88bc304fa4

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 Bytes

Contents

module Economic
  class ProductGroupRepo < Economic::BaseRepo
    def self.find_products(entry_number)
      end_point = [endpoint_url, entry_number, 'products'].join('/')
      response = test_response(RestClient.get(end_point, headers))
      entry_hash = JSON.parse(response.body)
      products = []

      entry_hash['collection'].each do |product|
        products.push Product.new(product)
      end
      products
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
economic-rest-0.2.5 lib/economic/product_group_repo.rb
economic-rest-0.2.4 lib/economic/product_group_repo.rb
economic-rest-0.2.3 lib/economic/product_group_repo.rb