Class: Bci::Hipotecario
- Inherits:
-
Base
- Object
- Base
- Bci::Hipotecario
show all
- Defined in:
- lib/bci/hipotecario.rb
Overview
The class for BCI hipotecario 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
13
|
# File 'lib/bci/hipotecario.rb', line 10
def all
puts url
response_checker(connector.get(url, ))
end
|
#find(id) ⇒ Object
15
16
17
18
|
# File 'lib/bci/hipotecario.rb', line 15
def find(id)
local_url = "#{url}/#{id}"
response_checker(connector.get(local_url, ))
end
|
#find_rates(id) ⇒ Object
28
29
30
31
|
# File 'lib/bci/hipotecario.rb', line 28
def find_rates(id)
local_url = "#{url}/#{id}/tasas"
response_checker(connector.get(local_url, ))
end
|
#simulate(id, params) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/bci/hipotecario.rb', line 20
def simulate(id, params)
local_url = "#{url}/#{id}/simulaciones"
puts local_url
response_checker(connector.post(local_url, params.to_json, ))
rescue RestClient::InternalServerError => e
puts e
end
|
#submodule ⇒ Object
6
7
8
|
# File 'lib/bci/hipotecario.rb', line 6
def submodule
'creditos_hipotecarios'
end
|