Class: Lyft::Client::Configuration
- Inherits:
-
Object
- Object
- Lyft::Client::Configuration
- Defined in:
- lib/lyft/client/configuration.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#debug_output ⇒ Object
readonly
Returns the value of attribute debug_output.
-
#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.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/lyft/client/configuration.rb', line 6 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) @debug_output = args[:debug_output] @client_secret = "SANDBOX-#{@client_secret}" if sandbox? end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/lyft/client/configuration.rb', line 4 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
4 5 6 |
# File 'lib/lyft/client/configuration.rb', line 4 def client_secret @client_secret end |
#debug_output ⇒ Object (readonly)
Returns the value of attribute debug_output.
4 5 6 |
# File 'lib/lyft/client/configuration.rb', line 4 def debug_output @debug_output end |
#use_sandbox ⇒ Object (readonly)
Returns the value of attribute use_sandbox.
4 5 6 |
# File 'lib/lyft/client/configuration.rb', line 4 def use_sandbox @use_sandbox end |
Instance Method Details
#sandbox? ⇒ Boolean
18 19 20 |
# File 'lib/lyft/client/configuration.rb', line 18 def sandbox? @use_sandbox end |