Sha256: b519fe69c49cd65faaffc1b711ea1baac28cc1f490b99cd73f17490d778fb633
Contents?: true
Size: 1.9 KB
Versions: 1
Compression:
Stored size: 1.9 KB
Contents
module Gman class Client include GmanClient::Api::CustomerContracts include GmanClient::Api::Orders include GmanClient::Api::HealthCheck include GmanClient::CommodityMerchandising::Contracts include GmanClient::Utility attr_accessor :url, :client_id, :client_secret def initialize(options) @url = options[:url] @token_url = "#{url}/oauth/token" @client_id = options[:client_id] @client_secret = options[:client_secret] @retry_attempts = options[:retries] || 3 end def drivers response = attempt(3) { request.api.v1.drivers.get } convert_payload(response) end def driver_commission_histories response = attempt(3) do request.api.v1.driver_commissions_history.get end convert_payload(response) end def driver_commission_histories_by_paid_date(paid_date) response = attempt(3) do request .api .v1 .driver_commissions_history_by_paid_date .get(params: { paid_date: paid_date }) end convert_payload(response) end def inventory_items response = attempt(3) { request.api.v1.inventory.items.get } convert_payload(response) end def inventory_items_like_id_description(item_id, in_item_description) response = attempt(3) do request .api .v1 .inventory .items_like_id_description .get( params: { item_id: item_id, in_item_description: in_item_description } ) end convert_payload(response) end def inventory_items_by_id(item_id) response = attempt(3) do request .api .v1 .inventory .items_by_id .get(params: { item_id: item_id }) end convert_payload([response].flatten) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gman_client-0.2.1 | lib/gman/client.rb |