Class: Lyft::Client::Configuration
- Inherits:
-
Object
- Object
- Lyft::Client::Configuration
- Defined in:
- lib/lyft/client/configuration.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#use_sandbox ⇒ Object
readonly
Returns the value of attribute use_sandbox.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #sandbox? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/lyft/client/configuration.rb', line 7 def initialize(args = {}) raise ArgumentError, ':client_id is missing' if args[:client_id].blank? raise ArgumentError, ':client_secret is missing' if args[:client_secret].blank? @client_id = args.fetch(:client_id) @client_secret = args.fetch(:client_secret) @use_sandbox = args.fetch(:use_sandbox, false) @headers = args[:headers] || {} @client_secret = "SANDBOX-#{@client_secret}" if sandbox? end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/lyft/client/configuration.rb', line 4 def access_token @access_token end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/lyft/client/configuration.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/lyft/client/configuration.rb', line 5 def client_secret @client_secret end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/lyft/client/configuration.rb', line 5 def headers @headers end |
#use_sandbox ⇒ Object (readonly)
Returns the value of attribute use_sandbox.
5 6 7 |
# File 'lib/lyft/client/configuration.rb', line 5 def use_sandbox @use_sandbox end |
Instance Method Details
#sandbox? ⇒ Boolean
19 20 21 |
# File 'lib/lyft/client/configuration.rb', line 19 def sandbox? @use_sandbox end |