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.
-
#usps_username ⇒ Object
Optional USPS username.
Instance Method Summary collapse
-
#check! ⇒ Object
Check the configuration.
Instance Attribute Details
#api_key ⇒ Object
TaxCloud API key.
7 8 9 |
# File 'lib/tax_cloud/configuration.rb', line 7 def api_key @api_key end |
#api_login_id ⇒ Object
TaxCloud login ID.
5 6 7 |
# File 'lib/tax_cloud/configuration.rb', line 5 def api_login_id @api_login_id end |
#usps_username ⇒ Object
Optional USPS username.
9 10 11 |
# File 'lib/tax_cloud/configuration.rb', line 9 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.
14 15 16 17 |
# File 'lib/tax_cloud/configuration.rb', line 14 def check! fail TaxCloud::Errors::MissingConfigOption.new('api_login_id') unless api_login_id && api_login_id.strip.length > 0 fail TaxCloud::Errors::MissingConfigOption.new('api_key') unless api_key && api_key.strip.length > 0 end |