Class: GoCardlessPro::Resources::TaxRate
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::TaxRate
- 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
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#jurisdiction ⇒ Object
readonly
Returns the value of attribute jurisdiction.
-
#percentage ⇒ Object
readonly
Returns the value of attribute percentage.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ TaxRate
constructor
Initialize a tax_rate resource instance.
-
#to_h ⇒ Object
Provides the tax_rate resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ TaxRate
Initialize a tax_rate resource instance
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_date ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
21 22 23 |
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 21 def id @id end |
#jurisdiction ⇒ Object (readonly)
Returns the value of attribute jurisdiction.
22 23 24 |
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 22 def jurisdiction @jurisdiction end |
#percentage ⇒ Object (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_date ⇒ Object (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 |
#type ⇒ Object (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_response ⇒ Object
41 42 43 |
# File 'lib/gocardless_pro/resources/tax_rate.rb', line 41 def api_response ApiResponse.new(@response) end |
#to_h ⇒ Object
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 |