Class: Suretax::Api::Tax

Inherits:
Object
  • Object
show all
Defined in:
lib/suretax/api/tax.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_params) ⇒ Tax

Returns a new instance of Tax.



6
7
8
9
10
11
12
13
14
15
# File 'lib/suretax/api/tax.rb', line 6

def initialize(response_params)
  @code = response_params.fetch('TaxTypeCode')
  @description = response_params.fetch('TaxTypeDesc')
  @amount = set_amount(response_params.fetch('TaxAmount').to_f)
  @revenue = response_params['Revenue']
  @county = response_params['CountyName']
  @city = response_params['CityName']
  @rate = set_amount(response_params['TaxRate'])
  @taxable = set_amount(response_params['PercentTaxable'])
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def amount
  @amount
end

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def city
  @city
end

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def code
  @code
end

#countyObject (readonly)

Returns the value of attribute county.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def county
  @county
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def description
  @description
end

#rateObject (readonly)

Returns the value of attribute rate.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def rate
  @rate
end

#revenueObject (readonly)

Returns the value of attribute revenue.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def revenue
  @revenue
end

#taxableObject (readonly)

Returns the value of attribute taxable.



4
5
6
# File 'lib/suretax/api/tax.rb', line 4

def taxable
  @taxable
end