Class: SilencerShop::Client

Inherits:
Base
  • Object
show all
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

Instance Method Summary collapse

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(options = {})
  requires!(options, :username, :password)
  @options = options

  authenticate!
end

Instance Attribute Details

#access_tokenObject

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

#dealerObject



37
38
39
# File 'lib/silencer_shop/client.rb', line 37

def dealer
  @dealer ||= SilencerShop::Dealer.new(self)
end

#orderObject



33
34
35
# File 'lib/silencer_shop/client.rb', line 33

def order
  @order ||= SilencerShop::Order.new(self)
end

#product_feedObject



29
30
31
# File 'lib/silencer_shop/client.rb', line 29

def product_feed
  @product_feed ||= SilencerShop::ProductFeed.new(self)
end