Class: GoPay::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



48
49
50
51
52
53
# File 'lib/gopay/config.rb', line 48

def initialize
  @country_codes = YAML.load_file File.join(BASE_PATH, "config", "country_codes.yml")
  config = YAML.load_file(File.join(BASE_PATH, "config", "config.yml"))
  @urls = config["urls"]
  @messages = config["messages"]
end

Instance Attribute Details

#country_codesObject (readonly)

Returns the value of attribute country_codes.



46
47
48
# File 'lib/gopay/config.rb', line 46

def country_codes
  @country_codes
end

#environmentObject

Returns the value of attribute environment.



45
46
47
# File 'lib/gopay/config.rb', line 45

def environment
  @environment
end

#failed_urlObject

Returns the value of attribute failed_url.



45
46
47
# File 'lib/gopay/config.rb', line 45

def failed_url
  @failed_url
end

#goidObject

Returns the value of attribute goid.



45
46
47
# File 'lib/gopay/config.rb', line 45

def goid
  @goid
end

#messagesObject (readonly)

Returns the value of attribute messages.



46
47
48
# File 'lib/gopay/config.rb', line 46

def messages
  @messages
end

#secure_keyObject

Returns the value of attribute secure_key.



45
46
47
# File 'lib/gopay/config.rb', line 45

def secure_key
  @secure_key
end

#success_urlObject

Returns the value of attribute success_url.



45
46
47
# File 'lib/gopay/config.rb', line 45

def success_url
  @success_url
end

Instance Method Details

#urlsObject



55
56
57
58
# File 'lib/gopay/config.rb', line 55

def urls
  env = @environment.nil? ? "test" : @environment.to_s
  @urls[env]
end