Class: A55::Client::BankSlip

Inherits:
Object
  • Object
show all
Defined in:
lib/a55/client/bank_slip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.
end

Instance Attribute Details

#clientObject

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.}/#{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.}/#{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(options = {}) 
  response = client.post("/boleto/#{client.}/export", options)
  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.}/#{id}")
  response.parsed_response
end

#where(options = {}) ⇒ Object



15
16
17
18
# File 'lib/a55/client/bank_slip.rb', line 15

def where(options = {})
  response = client.post("/boleto/search/#{client.}", options)
  response.parsed_response
end