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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30b66efa8d1d204697c00a0a922b07480e1dfc5f
4
- data.tar.gz: 88066875c448d7fcfc60132cd9e60b7add379a3c
3
+ metadata.gz: 56bfe8277fc7184ebafc2d645bc7172b72cba5a5
4
+ data.tar.gz: e11df3cbfdf848eb4f2ca977c811f1fc4f778151
5
5
  SHA512:
6
- metadata.gz: 4c2c6b41946ae3ce8d8c42157450fb325571a96f60f11e0fbb3e25679984709d73fbe415d274969ce087c1ff085430e61b98343db786d99414b4f7dcf904523a
7
- data.tar.gz: 4f2de135de1b2f770624d87837db83cc45e0d80bf0488b9891d385a7d1de30e53eec7fcd9c96130b1e8f7d2ebd1f92f50a6123801f6138aaade5df34d4ac90ab
6
+ metadata.gz: d449dd4307ad53e4773bf7fc3acaa496799a35ecae567dbf626912a20dd0c9214a75f335e01681871a69fb2e7a8f03afe80aa48f14cb30194e8a1f7e83dd4a9c
7
+ data.tar.gz: 4758cbceb06756b7221ac345bae01a80bd7c451321022e04f7851f89d87a2b036d5641223523eeb8e529903d23ef886581ffc36210dd1e55801c41c35b033ca6
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bci (0.1.0)
4
+ bci (18.0.0)
5
+ rest-client (>= 2.0.2)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -45,4 +46,4 @@ DEPENDENCIES
45
46
  rspec (~> 3)
46
47
 
47
48
  BUNDLED WITH
48
- 1.12.5
49
+ 1.15.4
@@ -1,29 +1,25 @@
1
- # encoding: utf-8
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
- #Metadata
6
- s.name = "bci"
7
- s.version = Bci::VERSION
8
- s.authors = ["Daniel Ochoa John"]
9
- s.email = ["dochoajohn@gmail.com"]
10
- s.homepage = "https://github.com/ProgramadoresChile/SDKBCI_Ruby"
11
- s.summary = %q{A SDK to connect to BCI developers API}
12
- s.description = %q{A SDK to connect with BCI developers API}
13
- s.licenses = ['Nonstandard']
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
- #Manifest
20
- s.files = `git ls-files`.split("\n")
21
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
- s.require_paths = ['lib']
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
@@ -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://api.us.apiconnect.ibmcloud.com/portal-api-developers-desarrollo/sandbox'.freeze
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
- 'x-ibm-client-id' => @api_key,
21
+ 'X-IBM-Client-Id' => @api_key,
22
22
  accept: 'application/json',
23
23
  content_type: 'application/json'
24
24
  }
@@ -4,11 +4,21 @@ module Bci
4
4
  # The class for BCI consumo API
5
5
  class Consumo < Base
6
6
  def submodule
7
- 'creditos_consumo'
7
+ 'creditos-consumo'
8
8
  end
9
9
 
10
- def simulate(params)
11
- response_checker(connector.post(url, params.to_json, headers))
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
@@ -1,3 +1,3 @@
1
1
  module Bci
2
- VERSION = '17.0.2'.freeze
2
+ VERSION = '18.0.0'.freeze
3
3
  end
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: 17.0.2
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: 2017-07-16 00:00:00.000000000 Z
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/ProgramadoresChile/SDKBCI_Ruby
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.4.5.1
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