Class: Judopay::Configuration
- Inherits:
-
Object
- Object
- Judopay::Configuration
- Defined in:
- lib/judopay.rb
Instance Attribute Summary collapse
-
#api_endpoints ⇒ Object
readonly
Returns the value of attribute api_endpoints.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#endpoint_url ⇒ Object
Returns the value of attribute endpoint_url.
-
#format ⇒ Object
Returns the value of attribute format.
-
#judo_id ⇒ Object
Returns the value of attribute judo_id.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#oauth_access_token ⇒ Object
Returns the value of attribute oauth_access_token.
-
#use_production ⇒ Object
Returns the value of attribute use_production.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Set sensible configuration defaults.
- #validate ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Set sensible configuration defaults
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/judopay.rb', line 52 def initialize @api_version = Judopay::API_VERSION @format = 'json' @use_production = false @user_agent = "Judopay Ruby (#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}) SDK gem v#{Judopay::SDK_VERSION}" @logger = Judopay::NullLogger.new @api_endpoints = { :sandbox => 'https://gw1.judopay-sandbox.com', :production => 'https://gw1.judopay.com' }.freeze @endpoint_url = @api_endpoints[:sandbox] end |
Instance Attribute Details
#api_endpoints ⇒ Object (readonly)
Returns the value of attribute api_endpoints.
49 50 51 |
# File 'lib/judopay.rb', line 49 def api_endpoints @api_endpoints end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
38 39 40 |
# File 'lib/judopay.rb', line 38 def api_secret @api_secret end |
#api_token ⇒ Object
Returns the value of attribute api_token.
38 39 40 |
# File 'lib/judopay.rb', line 38 def api_token @api_token end |
#api_version ⇒ Object
Returns the value of attribute api_version.
38 39 40 |
# File 'lib/judopay.rb', line 38 def api_version @api_version end |
#endpoint_url ⇒ Object
Returns the value of attribute endpoint_url.
38 39 40 |
# File 'lib/judopay.rb', line 38 def endpoint_url @endpoint_url end |
#format ⇒ Object
Returns the value of attribute format.
38 39 40 |
# File 'lib/judopay.rb', line 38 def format @format end |
#judo_id ⇒ Object
Returns the value of attribute judo_id.
38 39 40 |
# File 'lib/judopay.rb', line 38 def judo_id @judo_id end |
#logger ⇒ Object
Returns the value of attribute logger.
38 39 40 |
# File 'lib/judopay.rb', line 38 def logger @logger end |
#oauth_access_token ⇒ Object
Returns the value of attribute oauth_access_token.
38 39 40 |
# File 'lib/judopay.rb', line 38 def oauth_access_token @oauth_access_token end |
#use_production ⇒ Object
Returns the value of attribute use_production.
38 39 40 |
# File 'lib/judopay.rb', line 38 def use_production @use_production end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
38 39 40 |
# File 'lib/judopay.rb', line 38 def user_agent @user_agent end |
Instance Method Details
#validate ⇒ Object
65 66 67 68 |
# File 'lib/judopay.rb', line 65 def validate return true unless judo_id.to_s.empty? || api_token.to_s.empty? || api_secret.to_s.empty? raise Judopay::ValidationError, 'SDK configuration variables missing' end |