cnb 0.0.4 → 0.0.5
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/.gitignore +1 -0
- data/README.md +6 -1
- data/lib/cnb/cur_rates_parser.rb +1 -0
- data/lib/cnb/version.rb +1 -1
- data/spec/models/daily_cur_rates_parser_spec.rb +4 -0
- data/spec/models/monthly_cur_rates_parser_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5900cf0a63e8bfba9da32eb6e36f70898cb0a4c2
|
4
|
+
data.tar.gz: 099dad1d8d2db942144c5b11ffb20f416ead3e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5f7595d50d3cc5834ed71b73b90a5d9f786fd5ba503e6b9e4e26ac29662542b26acabfe812bc4e15be660ba767d7a4c23a337e167735f9eed73efe27c3aa922
|
7
|
+
data.tar.gz: 7c8e69002530cb07323d2b63ccae74940d39b22ab73586f079e9b51054ec0c823fb337a36708c7a72ccbd6cc2f182478fa1a230225751fd9d6898887b8f27b12
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
# CNB
|
1
|
+
# CNB
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/cnb)
|
4
|
+
[](https://travis-ci.org/ucetnictvi-on-line/cnb)
|
2
5
|
|
3
6
|
CNB is a gem that will help you get daily and monthly currency rates for czech crown (CZK) from Czech National Bank. Besides the currency rate you can also get name of the currency, name of the country where it is used and date when the currency rates were published.
|
4
7
|
|
@@ -38,6 +41,8 @@ Get name of the country where the currency comes from in czech language.
|
|
38
41
|
|
39
42
|
CNB.country('USD') # USA
|
40
43
|
|
44
|
+
The currency code is not case sensitive.
|
45
|
+
|
41
46
|
Get date when the currency rates were published. Czech National Bank does not publish currency rates during the weekend, so may want to check when exactly were the values published.
|
42
47
|
|
43
48
|
CNB.date
|
data/lib/cnb/cur_rates_parser.rb
CHANGED
data/lib/cnb/version.rb
CHANGED
@@ -16,6 +16,10 @@ describe CNB::DailyCurRatesParser do
|
|
16
16
|
expect(@parser.rate('USD')).to eq(19.927)
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'returns currency rate no matter the case of currency code' do
|
20
|
+
expect(@parser.rate('usd')).to eq(19.927)
|
21
|
+
end
|
22
|
+
|
19
23
|
it 'raises error if currency with given code is not included in the exchange rates file' do
|
20
24
|
expect{@parser.rate('USX')}.to raise_error(StandardError)
|
21
25
|
end
|
@@ -28,6 +28,10 @@ describe CNB::MonthlyCurRatesParser do
|
|
28
28
|
expect(@parser.rate('HNL')).to eq(1.024)
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'returns currency rate no matter the case of the currency code' do
|
32
|
+
expect(@parser.rate('hnl')).to eq(1.024)
|
33
|
+
end
|
34
|
+
|
31
35
|
it 'raises error if currency wth given code is not included in the exchange rates file' do
|
32
36
|
expect{@parser.rate('HNX')}.to raise_error(StandardError)
|
33
37
|
end
|