Class: TaxCloud::Configuration
- Inherits:
-
Object
- Object
- TaxCloud::Configuration
- Defined in:
- lib/tax_cloud/configuration.rb
Overview
TaxCloud gem configuration.
Instance Attribute Summary collapse
-
#api_key ⇒ Object
TaxCloud API key.
-
#api_login_id ⇒ Object
TaxCloud login ID.
-
#open_timeout ⇒ Object
Savon client option open_timeout.
-
#read_timeout ⇒ Object
Savon client option read_timeout.
-
#usps_username ⇒ Object
Optional USPS username.
Instance Method Summary collapse
-
#check! ⇒ Object
Check the configuration.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 |
# File 'lib/tax_cloud/configuration.rb', line 17 def initialize @open_timeout = 2 @read_timeout = 2 end |
Instance Attribute Details
#api_key ⇒ Object
TaxCloud API key.
9 10 11 |
# File 'lib/tax_cloud/configuration.rb', line 9 def api_key @api_key end |
#api_login_id ⇒ Object
TaxCloud login ID.
7 8 9 |
# File 'lib/tax_cloud/configuration.rb', line 7 def api_login_id @api_login_id end |
#open_timeout ⇒ Object
Savon client option open_timeout.
13 14 15 |
# File 'lib/tax_cloud/configuration.rb', line 13 def open_timeout @open_timeout end |
#read_timeout ⇒ Object
Savon client option read_timeout.
15 16 17 |
# File 'lib/tax_cloud/configuration.rb', line 15 def read_timeout @read_timeout end |
#usps_username ⇒ Object
Optional USPS username.
11 12 13 |
# File 'lib/tax_cloud/configuration.rb', line 11 def usps_username @usps_username end |
Instance Method Details
#check! ⇒ Object
Check the configuration.
Will raise a TaxCloud::Errors::MissingConfigOption if any of the API login ID or the API key are missing.
25 26 27 28 |
# File 'lib/tax_cloud/configuration.rb', line 25 def check! raise TaxCloud::Errors::MissingConfigOption, 'api_login_id' unless api_login_id && !api_login_id.strip.empty? raise TaxCloud::Errors::MissingConfigOption, 'api_key' unless api_key && !api_key.strip.empty? end |