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

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
# File 'lib/tax_cloud/configuration.rb', line 15

def initialize
  @open_timeout = 2
  @read_timeout = 2
end

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 
  
end

#open_timeoutObject

Savon client option open_timeout.



11
12
13
# File 'lib/tax_cloud/configuration.rb', line 11

def open_timeout
  @open_timeout
end

#read_timeoutObject

Savon client option read_timeout.



13
14
15
# File 'lib/tax_cloud/configuration.rb', line 13

def read_timeout
  @read_timeout
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.



23
24
25
26
# File 'lib/tax_cloud/configuration.rb', line 23

def check!
  raise TaxCloud::Errors::MissingConfigOption.new('api_login_id') unless  && !.strip.empty?
  raise TaxCloud::Errors::MissingConfigOption.new('api_key') unless api_key && !api_key.strip.empty?
end