Class: A55::Client::BankSlip
- Inherits:
-
Object
- Object
- A55::Client::BankSlip
- Defined in:
- lib/a55/client/bank_slip.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #change_due_date(bank_slip_id, new_date) ⇒ Object
- #download(bank_slip_id) ⇒ Object
- #export(options = {}) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(client) ⇒ BankSlip
constructor
A new instance of BankSlip.
- #where(options = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ BankSlip
Returns a new instance of BankSlip.
5 6 7 8 |
# File 'lib/a55/client/bank_slip.rb', line 5 def initialize(client) self.client = client raise A55::MissingAccountIdError unless client.account_id end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/a55/client/bank_slip.rb', line 4 def client @client end |
Instance Method Details
#change_due_date(bank_slip_id, new_date) ⇒ Object
30 31 32 33 |
# File 'lib/a55/client/bank_slip.rb', line 30 def change_due_date(bank_slip_id, new_date) response = client.post("/boleto/#{client.account_id}/#{bank_slip_id}/alterDueDate", {due_date: new_date}) response.parsed_response end |
#download(bank_slip_id) ⇒ Object
25 26 27 28 |
# File 'lib/a55/client/bank_slip.rb', line 25 def download(bank_slip_id) response = client.get("/boleto/#{client.account_id}/#{bank_slip_id}/pdf") response.parsed_response end |
#export(options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/a55/client/bank_slip.rb', line 20 def export( = {}) response = client.post("/boleto/#{client.account_id}/export", ) response.parsed_response end |
#find(id) ⇒ Object
10 11 12 13 |
# File 'lib/a55/client/bank_slip.rb', line 10 def find(id) response = client.get("/boleto/#{client.account_id}/#{id}") response.parsed_response end |
#where(options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/a55/client/bank_slip.rb', line 15 def where( = {}) response = client.post("/boleto/search/#{client.account_id}", ) response.parsed_response end |