eu_central_bank 1.2.0 → 1.3.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbbedf457cb6bfe27ebcab750a10b7c421fa6dc0
|
4
|
+
data.tar.gz: 1efc1e2652c6b46d712709d56ff94241c8eef871
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30de075118321b90fb3bbb1ebacf1f868f2cb58ce040206170850454b5bb3b9463ff9e93aa5fe162d23cf854844599c0d0856f42792523148c46697d177c46c9
|
7
|
+
data.tar.gz: 66649cfc85ca8a1b3e52274beea20c2cca160ae1489564da6eeed1c3a78b9baa3ef4849c4cd369480742400694aff3539b0360bed7a7e46a74977c1c1520119f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -47,7 +47,7 @@ Money.us_dollar(100).exchange_to("CAD") # Money.new(124, "CAD")
|
|
47
47
|
eu_bank.exchange_with(Money.new(100, "CAD"), "USD") # Money.new(80, "USD")
|
48
48
|
```
|
49
49
|
|
50
|
-
For performance reasons, you may prefer to read from a file instead. Furthermore, ECB publishes their rates daily. It makes sense to save the rates in a file to read from. It also adds an
|
50
|
+
For performance reasons, you may prefer to read from a file instead. Furthermore, ECB publishes their rates daily. It makes sense to save the rates in a file to read from. It also adds an `updated_at` field so that you can manage the update.
|
51
51
|
|
52
52
|
``` ruby
|
53
53
|
# cached location
|
data/lib/eu_central_bank.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'open-uri'
|
2
2
|
require 'nokogiri'
|
3
3
|
require 'money'
|
4
|
-
require 'money/rates_store/
|
4
|
+
require 'money/rates_store/store_with_historical_data_support'
|
5
5
|
|
6
6
|
class InvalidCache < StandardError ; end
|
7
7
|
|
@@ -16,13 +16,12 @@ class EuCentralBank < Money::Bank::VariableExchange
|
|
16
16
|
|
17
17
|
SERIALIZER_DATE_SEPARATOR = '_AT_'
|
18
18
|
|
19
|
-
CURRENCIES = %w(USD JPY BGN CZK DKK GBP HUF ILS PLN RON SEK CHF NOK HRK RUB TRY AUD BRL CAD CNY HKD IDR INR KRW MXN MYR NZD PHP SGD THB ZAR).map(&:freeze).freeze
|
19
|
+
CURRENCIES = %w(USD JPY BGN CZK DKK GBP HUF ILS ISK PLN RON SEK CHF NOK HRK RUB TRY AUD BRL CAD CNY HKD IDR INR KRW MXN MYR NZD PHP SGD THB ZAR).map(&:freeze).freeze
|
20
20
|
ECB_RATES_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'.freeze
|
21
21
|
ECB_90_DAY_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'.freeze
|
22
22
|
|
23
|
-
def initialize(
|
23
|
+
def initialize(st = Money::RatesStore::StoreWithHistoricalDataSupport.new, &block)
|
24
24
|
super
|
25
|
-
@store.extend Money::RatesStore::EuCentralBankHistoricalDataSupport
|
26
25
|
@currency_string = nil
|
27
26
|
end
|
28
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eu_central_bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Emmons
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.
|
33
|
+
version: 6.11.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.
|
40
|
+
version: 6.11.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,7 +64,7 @@ files:
|
|
64
64
|
- LICENSE
|
65
65
|
- README.md
|
66
66
|
- lib/eu_central_bank.rb
|
67
|
-
- lib/money/rates_store/
|
67
|
+
- lib/money/rates_store/store_with_historical_data_support.rb
|
68
68
|
homepage: https://github.com/RubyMoney/eu_central_bank
|
69
69
|
licenses: []
|
70
70
|
metadata: {}
|