Class: Billingrails::Resources::TaxRates
- Inherits:
-
Object
- Object
- Billingrails::Resources::TaxRates
- Defined in:
- lib/billingrails/resources/tax_rates.rb
Overview
Tax rates resource
Instance Method Summary collapse
-
#archive(id) ⇒ Hash
Archive a tax rate.
-
#create(data) ⇒ Hash
Create a tax rate.
-
#delete(id) ⇒ Hash
Delete a tax rate.
-
#initialize(client) ⇒ TaxRates
constructor
A new instance of TaxRates.
-
#list(params: nil) ⇒ Hash
List tax rates.
-
#retrieve(id, params: nil) ⇒ Hash
Retrieve tax rate.
-
#update(id, data) ⇒ Hash
Update a tax rate.
Constructor Details
#initialize(client) ⇒ TaxRates
Returns a new instance of TaxRates.
10 11 12 |
# File 'lib/billingrails/resources/tax_rates.rb', line 10 def initialize(client) @client = client end |
Instance Method Details
#archive(id) ⇒ Hash
Archive a tax rate
Archives a tax rate.
77 78 79 80 |
# File 'lib/billingrails/resources/tax_rates.rb', line 77 def archive(id) path = "/tax_rates/#{id}/archive" @client.request(:post, path) end |
#create(data) ⇒ Hash
Create a tax rate
Creates a tax rate.
31 32 33 34 |
# File 'lib/billingrails/resources/tax_rates.rb', line 31 def create(data) path = "/tax_rates" @client.request(:post, path, body: data) end |
#delete(id) ⇒ Hash
Delete a tax rate
Deletes a tax rate.
66 67 68 69 |
# File 'lib/billingrails/resources/tax_rates.rb', line 66 def delete(id) path = "/tax_rates/#{id}" @client.request(:delete, path) end |
#list(params: nil) ⇒ Hash
List tax rates
Retrieve a list of tax rates.
20 21 22 23 |
# File 'lib/billingrails/resources/tax_rates.rb', line 20 def list(params: nil) path = "/tax_rates" @client.request(:get, path, params: params) end |
#retrieve(id, params: nil) ⇒ Hash
Retrieve tax rate
Retrieves a tax rate by ID.
43 44 45 46 |
# File 'lib/billingrails/resources/tax_rates.rb', line 43 def retrieve(id, params: nil) path = "/tax_rates/#{id}" @client.request(:get, path, params: params) end |
#update(id, data) ⇒ Hash
Update a tax rate
Updates a tax rate.
55 56 57 58 |
# File 'lib/billingrails/resources/tax_rates.rb', line 55 def update(id, data) path = "/tax_rates/#{id}" @client.request(:put, path, body: data) end |