Class: GoCardlessPro::Resources::TaxRate

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/tax_rate.rb

Overview

Tax rates from tax authority.

We also maintain a [static list of the tax rates for each jurisdiction](#appendix-tax-rates).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ TaxRate

Initialize a tax_rate resource instance

Parameters:

  • object (Hash)

    an object returned from the API



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 22

def initialize(object, response = nil)
  @object = object

  @end_date = object['end_date']
  @id = object['id']
  @jurisdiction = object['jurisdiction']
  @percentage = object['percentage']
  @start_date = object['start_date']
  @type = object['type']
  @response = response
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def end_date
  @end_date
end

#idObject (readonly)

Returns the value of attribute id.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def id
  @id
end

#jurisdictionObject (readonly)

Returns the value of attribute jurisdiction.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def jurisdiction
  @jurisdiction
end

#percentageObject (readonly)

Returns the value of attribute percentage.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def percentage
  @percentage
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def start_date
  @start_date
end

#typeObject (readonly)

Returns the value of attribute type.



18
19
20
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 18

def type
  @type
end

Instance Method Details

#api_responseObject



34
35
36
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 34

def api_response
  ApiResponse.new(@response)
end

#to_hObject

Provides the tax_rate resource as a hash of all its readable attributes



39
40
41
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 39

def to_h
  @object
end