Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/Configuration.rb
Instance Attribute Summary collapse
-
#apiBase ⇒ Object
readonly
Returns the value of attribute apiBase.
-
#privateKey ⇒ Object
Returns the value of attribute privateKey.
-
#publicKey ⇒ Object
Returns the value of attribute publicKey.
Instance Method Summary collapse
-
#initialize(publicKey, privateKey, enviroment) ⇒ Configuration
constructor
A new instance of Configuration.
- #set_enviroment(apiBase) ⇒ Object
Constructor Details
#initialize(publicKey, privateKey, enviroment) ⇒ Configuration
Returns a new instance of Configuration.
2 3 4 5 6 |
# File 'lib/Configuration.rb', line 2 def initialize(publicKey, privateKey, enviroment) @publicKey = publicKey @privateKey = privateKey @apiBase = set_enviroment(enviroment) end |
Instance Attribute Details
#apiBase ⇒ Object (readonly)
Returns the value of attribute apiBase.
29 30 31 |
# File 'lib/Configuration.rb', line 29 def apiBase @apiBase end |
#privateKey ⇒ Object
Returns the value of attribute privateKey.
25 26 27 |
# File 'lib/Configuration.rb', line 25 def privateKey @privateKey end |
#publicKey ⇒ Object
Returns the value of attribute publicKey.
21 22 23 |
# File 'lib/Configuration.rb', line 21 def publicKey @publicKey end |
Instance Method Details
#set_enviroment(apiBase) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/Configuration.rb', line 8 def set_enviroment(apiBase) case apiBase when 'production' 'https://api.paymentrails.com' when 'development' 'http://api.railz.io' when 'integration' 'http://api.local.dev:3000' else 'https://api.paymentrails.com' end end |