Class: Bci::Consumo
Overview
The class for BCI consumo API
Constant Summary
Constants inherited
from Base
Base::BASE_URL
Instance Method Summary
collapse
Methods inherited from Base
#connector, #headers, #initialize, #response_checker, #url
Constructor Details
This class inherits a constructor from Bci::Base
Instance Method Details
#all ⇒ Object
10
11
12
|
# File 'lib/bci/consumo.rb', line 10
def all
response_checker(connector.get(url, ))
end
|
#find(id) ⇒ Object
14
15
16
17
|
# File 'lib/bci/consumo.rb', line 14
def find(id)
local_url = "#{url}/#{id}"
response_checker(connector.get(local_url, ))
end
|
#simulate(id, params) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/bci/consumo.rb', line 19
def simulate(id, params)
local_url = "#{url}/#{id}/simulaciones"
response_checker(connector.post(local_url, params.to_json, ))
rescue RestClient::InternalServerError => e
puts e
end
|
#submodule ⇒ Object
6
7
8
|
# File 'lib/bci/consumo.rb', line 6
def submodule
'creditos-consumo'
end
|