Class: Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/Configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#apiBaseObject (readonly)

Returns the value of attribute apiBase.



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

def apiBase
  @apiBase
end

#privateKeyObject

Returns the value of attribute privateKey.



25
26
27
# File 'lib/Configuration.rb', line 25

def privateKey
  @privateKey
end

#publicKeyObject

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