bci 17.0.2 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -2
- data/bci.gemspec +21 -25
- data/lib/bci/base.rb +2 -2
- data/lib/bci/consumo.rb +13 -3
- data/lib/bci/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56bfe8277fc7184ebafc2d645bc7172b72cba5a5
|
4
|
+
data.tar.gz: e11df3cbfdf848eb4f2ca977c811f1fc4f778151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d449dd4307ad53e4773bf7fc3acaa496799a35ecae567dbf626912a20dd0c9214a75f335e01681871a69fb2e7a8f03afe80aa48f14cb30194e8a1f7e83dd4a9c
|
7
|
+
data.tar.gz: 4758cbceb06756b7221ac345bae01a80bd7c451321022e04f7851f89d87a2b036d5641223523eeb8e529903d23ef886581ffc36210dd1e55801c41c35b033ca6
|
data/Gemfile.lock
CHANGED
data/bci.gemspec
CHANGED
@@ -1,29 +1,25 @@
|
|
1
|
-
|
2
|
-
require File.expand_path("../lib/bci/version", __FILE__)
|
1
|
+
require File.expand_path('../lib/bci/version', __FILE__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |s|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# If you want to show a post-install message, uncomment the following lines
|
15
|
-
# s.post_install_message = <<-MSG
|
16
|
-
#
|
17
|
-
#MSG
|
4
|
+
# Metadata
|
5
|
+
s.name = 'bci'
|
6
|
+
s.version = Bci::VERSION
|
7
|
+
s.authors = ['Daniel Ochoa John']
|
8
|
+
s.email = ['dochoajohn@gmail.com']
|
9
|
+
s.homepage = 'https://www.github.com/dochoaj'
|
10
|
+
s.summary = 'A SDK to connect to BCI developers API'
|
11
|
+
s.description = 'A SDK to connect with BCI developers API'
|
12
|
+
s.licenses = ['Nonstandard']
|
13
|
+
# If you want to show a post-install message, uncomment the following lines
|
14
|
+
# s.post_install_message = <<-MSG
|
15
|
+
#
|
16
|
+
# MSG
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
s.add_development_dependency 'rspec', '~> 3'
|
28
|
-
s.add_runtime_dependency 'rest-client', '>= 2.0.2'
|
18
|
+
# Manifest
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
22
|
+
s.require_paths = ['lib']
|
23
|
+
s.add_development_dependency 'rspec', '~> 3'
|
24
|
+
s.add_runtime_dependency 'rest-client', '>= 2.0.2'
|
29
25
|
end
|
data/lib/bci/base.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Bci
|
2
2
|
# The base class for all api clients
|
3
3
|
class Base
|
4
|
-
BASE_URL = 'https://
|
4
|
+
BASE_URL = 'https://apidevelopers.bci.cl'.freeze
|
5
5
|
|
6
6
|
def initialize(key = nil)
|
7
7
|
@api_key = key
|
@@ -18,7 +18,7 @@ module Bci
|
|
18
18
|
|
19
19
|
def headers
|
20
20
|
{
|
21
|
-
'
|
21
|
+
'X-IBM-Client-Id' => @api_key,
|
22
22
|
accept: 'application/json',
|
23
23
|
content_type: 'application/json'
|
24
24
|
}
|
data/lib/bci/consumo.rb
CHANGED
@@ -4,11 +4,21 @@ module Bci
|
|
4
4
|
# The class for BCI consumo API
|
5
5
|
class Consumo < Base
|
6
6
|
def submodule
|
7
|
-
'
|
7
|
+
'creditos-consumo'
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
response_checker(connector.
|
10
|
+
def all
|
11
|
+
response_checker(connector.get(url, headers))
|
12
|
+
end
|
13
|
+
|
14
|
+
def find(id)
|
15
|
+
local_url = "#{url}/#{id}"
|
16
|
+
response_checker(connector.get(local_url, headers))
|
17
|
+
end
|
18
|
+
|
19
|
+
def simulate(id, params)
|
20
|
+
local_url = "#{url}/#{id}/simulaciones"
|
21
|
+
response_checker(connector.post(local_url, params.to_json, headers))
|
12
22
|
rescue RestClient::InternalServerError => e
|
13
23
|
puts e
|
14
24
|
end
|
data/lib/bci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 18.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Ochoa John
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -60,7 +60,7 @@ files:
|
|
60
60
|
- lib/bci/stats.rb
|
61
61
|
- lib/bci/version.rb
|
62
62
|
- spec/spec_helper.rb
|
63
|
-
homepage: https://github.com/
|
63
|
+
homepage: https://www.github.com/dochoaj
|
64
64
|
licenses:
|
65
65
|
- Nonstandard
|
66
66
|
metadata: {}
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.2.1
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: A SDK to connect to BCI developers API
|