Class: Billingrails::Resources::Invoices
- Inherits:
-
Object
- Object
- Billingrails::Resources::Invoices
- Defined in:
- lib/billingrails/resources/invoices.rb
Overview
Invoices resource
Instance Method Summary collapse
-
#create(data) ⇒ Hash
Create an invoice.
-
#initialize(client) ⇒ Invoices
constructor
A new instance of Invoices.
-
#issue(id, data) ⇒ Hash
Issue an invoice.
-
#list(params: nil) ⇒ Hash
List invoices.
-
#retrieve(id, params: nil) ⇒ Hash
Retrieve invoice.
-
#update(id, data) ⇒ Hash
Update an invoice.
Constructor Details
#initialize(client) ⇒ Invoices
Returns a new instance of Invoices.
10 11 12 |
# File 'lib/billingrails/resources/invoices.rb', line 10 def initialize(client) @client = client end |
Instance Method Details
#create(data) ⇒ Hash
Create an invoice
Creates an invoice.
31 32 33 34 |
# File 'lib/billingrails/resources/invoices.rb', line 31 def create(data) path = "/invoices" @client.request(:post, path, body: data) end |
#issue(id, data) ⇒ Hash
Issue an invoice
Issues an invoice.
43 44 45 46 |
# File 'lib/billingrails/resources/invoices.rb', line 43 def issue(id, data) path = "/invoices/#{id}/issue" @client.request(:post, path, body: data) end |
#list(params: nil) ⇒ Hash
List invoices
Retrieves a list of invoices.
20 21 22 23 |
# File 'lib/billingrails/resources/invoices.rb', line 20 def list(params: nil) path = "/invoices" @client.request(:get, path, params: params) end |
#retrieve(id, params: nil) ⇒ Hash
Retrieve invoice
Retrieves an invoice by ID.
55 56 57 58 |
# File 'lib/billingrails/resources/invoices.rb', line 55 def retrieve(id, params: nil) path = "/invoices/#{id}" @client.request(:get, path, params: params) end |
#update(id, data) ⇒ Hash
Update an invoice
Updates an invoice.
67 68 69 70 |
# File 'lib/billingrails/resources/invoices.rb', line 67 def update(id, data) path = "/invoices/#{id}" @client.request(:put, path, body: data) end |