class Genba::Client::Products

Public Class Methods

new(client) click to toggle source
# File lib/genba/client/products.rb, line 6
def initialize(client)
  @client = client
end

Public Instance Methods

get(sku_id, headers: {}) click to toggle source

Return information about a product

# File lib/genba/client/products.rb, line 11
def get(sku_id, headers: {})
  payload = {
  }.select { |_, v| !v.nil? }

  @client.rest_get_with_token("/products/#{sku_id}", payload, headers)
end
list(country_code: nil, include_meta: nil, from_date: nil, deleted: nil, continuation_token: nil, headers: {}) click to toggle source

Gets a collection of available products

# File lib/genba/client/products.rb, line 19
def list(country_code: nil, include_meta: nil, from_date: nil, deleted: nil, continuation_token: nil, headers: {})
  payload = {
    countryCode: country_code,
    includeMeta: include_meta,
    fromDate: from_date,
    deleted: deleted,
    continuationtoken: continuation_token
  }.select { |_, v| !v.nil? }

  @client.rest_get_with_token('/products', payload, headers)
end