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 (https://developer.gocardless.com/api-reference/#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



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 27

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.



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

def id
  @id
end

#jurisdictionObject (readonly)

Returns the value of attribute jurisdiction.



20
21
22
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 20

def jurisdiction
  @jurisdiction
end

#percentageObject (readonly)

Returns the value of attribute percentage.



21
22
23
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 21

def percentage
  @percentage
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



22
23
24
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 22

def start_date
  @start_date
end

#typeObject (readonly)

Returns the value of attribute type.



23
24
25
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 23

def type
  @type
end

Instance Method Details

#api_responseObject



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

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



44
45
46
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 44

def to_h
  @object
end