Class: Suretax::Configuration
- Inherits:
-
Object
- Object
- Suretax::Configuration
- Includes:
- Singleton
- Defined in:
- lib/suretax/configuration.rb
Constant Summary collapse
- REQUEST_VERSIONS =
[1, 2, 3, 4].freeze
- CANCEL_VERSIONS =
[1].freeze
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#cancel_version ⇒ Object
Returns the value of attribute cancel_version.
-
#client_number ⇒ Object
Returns the value of attribute client_number.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#request_version ⇒ Object
Returns the value of attribute request_version.
-
#validation_key ⇒ Object
Returns the value of attribute validation_key.
Instance Method Summary collapse
- #cancel_path ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #request_path ⇒ Object
- #test? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 |
# File 'lib/suretax/configuration.rb', line 13 def initialize register_currencies @base_url = test_host @request_version = REQUEST_VERSIONS.max @cancel_version = CANCEL_VERSIONS.max end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def base_url @base_url end |
#cancel_version ⇒ Object
Returns the value of attribute cancel_version.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def cancel_version @cancel_version end |
#client_number ⇒ Object
Returns the value of attribute client_number.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def client_number @client_number end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def logger @logger end |
#request_version ⇒ Object
Returns the value of attribute request_version.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def request_version @request_version end |
#validation_key ⇒ Object
Returns the value of attribute validation_key.
10 11 12 |
# File 'lib/suretax/configuration.rb', line 10 def validation_key @validation_key end |
Instance Method Details
#cancel_path ⇒ Object
49 50 51 52 |
# File 'lib/suretax/configuration.rb', line 49 def cancel_path @cancel_path ||= "/Services/V%02d/SureTax.asmx/CancelPostRequest" % cancel_version end |
#request_path ⇒ Object
44 45 46 47 |
# File 'lib/suretax/configuration.rb', line 44 def request_path @request_path ||= "/Services/V%02d/SureTax.asmx/PostRequest" % request_version end |
#test? ⇒ Boolean
20 21 22 |
# File 'lib/suretax/configuration.rb', line 20 def test? base_url == test_host end |