bcn_ni 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0e01abc9ca4e65e1f22527f880650253b861badbd36e6b7f4c387e44a0fc04
4
- data.tar.gz: c9b29f47fca3b6dec463b896b665ab65907f22ad45645941ab06a1e806d265fc
3
+ metadata.gz: a1c66337b41a7c0920341442f6f5ee66ec69b4aeb6154c940bb9a58cd073dcea
4
+ data.tar.gz: fb5a527398cba7ca4f8bc8662f456701493a476876ff5956390ffd36f7e41dee
5
5
  SHA512:
6
- metadata.gz: 677ca5cc3b6f864b40e4573ad0fe0c978ec3929b6262eb1212f9ec9455ddfe107b268db429af33cdbf97a70b20a325a56922335736130600e760201f20b46157
7
- data.tar.gz: ed2a566e0fc5477a53fbd9c24abbc0f22ac7adee37c397857a10dd2beeceaffb675aae64c0910ffc37acc66154026ebe2ee76ba5082416c83f6d75fef7ace016
6
+ metadata.gz: 61512751cd5a396b6b236e06501681e269fc84f0e4e323276022c92a9d8890ad837b61cdd8027b82fe079de9c19415275e136c41349dfafc2173fb3a8ebfc03e
7
+ data.tar.gz: f8b98e011ddd4dc15f282d9c80cc5d6f60f99ae4ca6501ebee28c2cd534e0527a853c26c14ae3acc5bfefb8166af0062edc10ce7b0f64a4d449d244cad4cc032
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # BcnNi
2
+
2
3
  This gem provides NIO (Córdoba Oro Nicaragüense) against USD (United States Dollar) money exchange rates consuming the official Central Bank of Nicaragüa (BCN) SOAP Service or HTML page
3
4
 
4
5
  ## Basic usage
6
+
5
7
  ```ruby
6
8
  # Returns the exchange rate for September 15th, 2017
7
9
  day_rate = BcnNi.exchange_day(2017, 9, 15)
@@ -47,6 +49,7 @@ month_rate = BcnNi.exchange_month(2017, 9)
47
49
  ```
48
50
 
49
51
  ## Changing the request mode
52
+
50
53
  For changing the request mode simply add `request_mode` argument at the end of the method args. **The default request mode is scrapping** (which incredibly resulted to be faster than SOAP and with 24/7 availability). You can change this like the example given below:
51
54
 
52
55
  ```ruby
@@ -58,8 +61,8 @@ day_rate = BcnNi.exchange_day(2017, 9, 15, request_mode: :soap)
58
61
  month_rate = BcnNi.exchange_month(2017, 9, request_mode: :soap)
59
62
  ```
60
63
 
61
-
62
64
  ## Installation
65
+
63
66
  Add this line to your application's Gemfile:
64
67
 
65
68
  ```ruby
@@ -67,19 +70,28 @@ Add this line to your application's Gemfile:
67
70
  gem 'bcn_ni', git: 'https://github.com/mldoscar/bcn_ni', branch: 'master'
68
71
 
69
72
  # From ruby gems
70
- gem 'bcn_ni', '>= 0.1.4'
73
+ gem 'bcn_ni', '>= 0.1.5'
71
74
 
72
75
  # Using gem install
73
76
  gem install bcn_ni
74
77
  ```
75
78
 
76
79
  And then execute:
80
+
77
81
  ```bash
78
82
  $ bundle
79
83
  ```
80
84
 
85
+ ## Changelog
86
+
87
+ ```
88
+ 2021.06.28 - Bugfix: Cambio en el URI para el request de scrapping, el BCN cambió de parámetros y ubicación de URL
89
+ ```
90
+
81
91
  ## Contributing
92
+
82
93
  You guys are free to send your pull requests for contributing. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
83
94
 
84
95
  ## License
96
+
85
97
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -30,7 +30,7 @@ module BcnNi
30
30
 
31
31
  case @request_mode
32
32
  when :scrapping
33
- @request_url = "https://www.bcn.gob.ni/estadisticas/mercados_cambiarios/tipo_cambio/cordoba_dolar/mes.php"
33
+ @request_url = "https://www.bcn.gob.ni/IRR/tipo_cambio_mensual/mes.php"
34
34
  when :soap
35
35
  # See 'https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx' for more info about how to build a RAW SOAP request
36
36
  @request_url = "https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx?WSDL"
@@ -79,12 +79,11 @@ module BcnNi
79
79
  def scra__exchange_month(year, month)
80
80
  # Parse the date
81
81
  start_date = Date.new(year, month, 1)
82
- end_date = start_date.end_of_month
83
82
 
84
83
  # Create the arg hash
85
84
  args = {
86
- Fecha_inicial: start_date,
87
- Fecha_final: end_date
85
+ mes: start_date.strftime('%d'),
86
+ anio: start_date.strftime('%Y')
88
87
  }
89
88
 
90
89
  # Generate the full url
@@ -1,3 +1,3 @@
1
1
  module BcnNi
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcn_ni
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Rodriguez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -88,7 +88,7 @@ homepage: https://github.com/mldoscar/bcn_ni
88
88
  licenses:
89
89
  - MIT
90
90
  metadata: {}
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
@@ -103,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.7.7
108
- signing_key:
106
+ rubygems_version: 3.0.6
107
+ signing_key:
109
108
  specification_version: 4
110
109
  summary: This tool pretends to be helpful for developers who can request exchange
111
110
  rates from Nicaragua in a easier way