Class: Lightspeed::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rate_limit: nil) ⇒ Configuration

Returns a new instance of Configuration.



5
6
7
8
# File 'lib/lightspeed/configuration.rb', line 5

def initialize(rate_limit: nil)
  @rate_limit = rate_limit || false
  @environment = :production
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



3
4
5
# File 'lib/lightspeed/configuration.rb', line 3

def environment
  @environment
end

#rate_limitObject

Returns the value of attribute rate_limit.



3
4
5
# File 'lib/lightspeed/configuration.rb', line 3

def rate_limit
  @rate_limit
end

Instance Method Details

#serverObject



18
19
20
21
22
23
24
25
# File 'lib/lightspeed/configuration.rb', line 18

def server
  case environment
  when :development
    "http://#{ENV['GATEWAY_SERVER'] || 'localhost:3000'}"
  when :production
    "https://api.merchantos.com/API/"
  end
end