Class: TaxCloud::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/tax_cloud/configuration.rb

Overview

TaxCloud gem configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

TaxCloud API key.



7
8
9
# File 'lib/tax_cloud/configuration.rb', line 7

def api_key
  @api_key
end

#api_login_idObject

TaxCloud login ID.



5
6
7
# File 'lib/tax_cloud/configuration.rb', line 5

def 
  @api_login_id
end

#usps_usernameObject

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  && .strip.length > 0
  fail TaxCloud::Errors::MissingConfigOption.new('api_key') unless api_key && api_key.strip.length > 0
end