Class: Vend::Oauth2::Client
- Includes:
- Logable
- Defined in:
- lib/vend/oauth2/client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{}
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#store ⇒ Object
Returns the value of attribute store.
Attributes included from Logable
Attributes inherited from Client
#options, #password, #username
Instance Method Summary collapse
- #http_client ⇒ Object
- #http_client_options ⇒ Object
-
#initialize(store, auth_token, options = {}) ⇒ Client
constructor
A new instance of Client.
Methods inherited from Client
#Customer, #Outlet, #PaymentType, #Product, #Register, #RegisterSale, #Supplier, #Tax, #User, #base_url
Constructor Details
#initialize(store, auth_token, options = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 |
# File 'lib/vend/oauth2/client.rb', line 10 def initialize(store, auth_token, = {}) @store = store @auth_token = auth_token @options = DEFAULT_OPTIONS.merge() end |
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
8 9 10 |
# File 'lib/vend/oauth2/client.rb', line 8 def auth_token @auth_token end |
#store ⇒ Object
Returns the value of attribute store.
8 9 10 |
# File 'lib/vend/oauth2/client.rb', line 8 def store @store end |
Instance Method Details
#http_client ⇒ Object
16 17 18 |
# File 'lib/vend/oauth2/client.rb', line 16 def http_client @http_client ||= Vend::HttpClient.new() end |
#http_client_options ⇒ Object
20 21 22 23 24 |
# File 'lib/vend/oauth2/client.rb', line 20 def .merge( auth_token: @auth_token, base_url: base_url ) end |