Class: Payrix::Configuration
- Inherits:
-
Object
- Object
- Payrix::Configuration
- Defined in:
- lib/payrix/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#exception_enabled ⇒ Object
Returns the value of attribute exception_enabled.
-
#session_key ⇒ Object
Returns the value of attribute session_key.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_test_mode(test) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/payrix/configuration.rb', line 8 def initialize @url = 'https://api.payrix.com' @api_key = '' @session_key = '' @exception_enabled = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/payrix/configuration.rb', line 6 def api_key @api_key end |
#exception_enabled ⇒ Object
Returns the value of attribute exception_enabled.
6 7 8 |
# File 'lib/payrix/configuration.rb', line 6 def exception_enabled @exception_enabled end |
#session_key ⇒ Object
Returns the value of attribute session_key.
6 7 8 |
# File 'lib/payrix/configuration.rb', line 6 def session_key @session_key end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/payrix/configuration.rb', line 5 def url @url end |
Instance Method Details
#set_test_mode(test) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/payrix/configuration.rb', line 19 def set_test_mode(test) host = URI.parse(url).host if test == true if !host.start_with?('test-') @url = "https://test-#{host}" end else if host.start_with?('test-') @url = "https://#{host[5..-1]}" end end end |