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



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

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.



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

def end_date
  @end_date
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#jurisdictionObject (readonly)

Returns the value of attribute jurisdiction.



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

def jurisdiction
  @jurisdiction
end

#percentageObject (readonly)

Returns the value of attribute percentage.



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

def percentage
  @percentage
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



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

def start_date
  @start_date
end

#typeObject (readonly)

Returns the value of attribute type.



25
26
27
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 25

def type
  @type
end

Instance Method Details

#api_responseObject



41
42
43
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 41

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



46
47
48
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 46

def to_h
  @object
end