Class: Monri::Config
- Inherits:
-
Object
- Object
- Monri::Config
- Defined in:
- lib/monri/config.rb
Defined Under Namespace
Classes: InvalidConfiguration
Constant Summary collapse
- SUPPORTED_ENVS =
%w[test production].freeze
Instance Attribute Summary collapse
-
#authenticity_token ⇒ Object
Returns the value of attribute authenticity_token.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#merchant_key ⇒ Object
Returns the value of attribute merchant_key.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#authenticity_token ⇒ Object
Returns the value of attribute authenticity_token.
6 7 8 |
# File 'lib/monri/config.rb', line 6 def authenticity_token @authenticity_token end |
#environment ⇒ Object
Returns the value of attribute environment.
27 28 29 |
# File 'lib/monri/config.rb', line 27 def environment @environment end |
#merchant_key ⇒ Object
Returns the value of attribute merchant_key.
5 6 7 |
# File 'lib/monri/config.rb', line 5 def merchant_key @merchant_key end |
Class Method Details
.default_config ⇒ Object
21 22 23 24 25 |
# File 'lib/monri/config.rb', line 21 def self.default_config rv = Config.new rv.environment = :test rv end |
Instance Method Details
#base_api_url ⇒ String
11 12 13 14 15 16 17 18 19 |
# File 'lib/monri/config.rb', line 11 def base_api_url if environment == 'test' 'https://ipgtest.monri.com' elsif environment == 'production' 'https://ipg.monri.com' else raise ArgumentError, "Environment=#{environment} not supported" end end |
#configured? ⇒ Boolean
38 39 40 |
# File 'lib/monri/config.rb', line 38 def configured? !merchant_key.nil? && !authenticity_token.nil? && !environment.nil? end |