Class: SilencerShop::Client
- Includes:
- API
- Defined in:
- lib/silencer_shop/client.rb
Constant Summary collapse
- TOKEN_RESOURCE =
{ development: 'https://silencershopstaging.onmicrosoft.com/SilencerShop.Portal'.freeze, production: 'https://silencershopsso.onmicrosoft.com/SilencerShop.Portal'.freeze }
- TOKEN_URL =
{ development: 'silencershopstaging.onmicrosoft.com/oauth2/token'.freeze, production: 'silencershopsso.onmicrosoft.com/oauth2/token'.freeze }
Constants included from API
API::API_URL, API::FILE_UPLOAD_ATTRS, API::USER_AGENT
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
- #dealer ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #order ⇒ Object
- #product_feed ⇒ Object
Methods included from API
#get_request, #post_file_request, #post_request
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
22 23 24 25 26 27 |
# File 'lib/silencer_shop/client.rb', line 22 def initialize( = {}) requires!(, :username, :password) @options = authenticate! end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
20 21 22 |
# File 'lib/silencer_shop/client.rb', line 20 def access_token @access_token end |
Instance Method Details
#dealer ⇒ Object
37 38 39 |
# File 'lib/silencer_shop/client.rb', line 37 def dealer @dealer ||= SilencerShop::Dealer.new(self) end |
#order ⇒ Object
33 34 35 |
# File 'lib/silencer_shop/client.rb', line 33 def order @order ||= SilencerShop::Order.new(self) end |
#product_feed ⇒ Object
29 30 31 |
# File 'lib/silencer_shop/client.rb', line 29 def product_feed @product_feed ||= SilencerShop::ProductFeed.new(self) end |