mrpin-sdk 1.0.83 → 1.0.84

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: 73e96429e6ca3d2b59feed79c4af902e2096cb48
4
- data.tar.gz: ba88b3bc0a99d8d6b61b9ce282c0db3f43a0db00
3
+ metadata.gz: dda4f137c71e6f85fe7271e5237e99ee212a2638
4
+ data.tar.gz: 55af249c768610da0d19cf185c4c8ece54201985
5
5
  SHA512:
6
- metadata.gz: a96c7fd114932531aa8e0b6929d02c456aafcf2bf802bdb88e839d28d782fd70ef6200a82514a2328b486881d2b626079dc0578aa21463a17a860d208e98df1c
7
- data.tar.gz: fdb6165523c4f8c8086938d839512c59a22e47a4d7f38c1dcbbc19b2f5195412a6de5b8d879cc6000923c93fc351b4811a4c080e6dd6ad47112ace876302d4d7
6
+ metadata.gz: 38b2d0303f2472f95bbd7f873f220ce5cfcc6b31d18d883a352b7a8ec8f8e8f3dfee3768b85596be596195d0ce2fd5b4e01c57b929993ee0c1ab132f5577cd48
7
+ data.tar.gz: 97d4e9e58e37330bc09c58512d4a42b82e65020179683d54bc34e1477edb86b35a41f3655a6b311c9e6d5b931b1950108954bfd7da23d2da7bd7d584898c2f2a
@@ -19,6 +19,7 @@ class ExchangerFixer < ExchangerBase
19
19
 
20
20
  public
21
21
  def get_rate(from_currency, to_currency)
22
+ result = nil
22
23
 
23
24
  params =
24
25
  {
@@ -32,9 +33,15 @@ class ExchangerFixer < ExchangerBase
32
33
 
33
34
  response_exchanger = JSON.parse response[:response], {symbolize_names: true}
34
35
 
35
- rate_string = response_exchanger.assert_property!(:rates).assert_property!(to_currency.to_sym)
36
+ rates = response_exchanger.assert_property!(:rates)
36
37
 
37
- rate_string.to_f
38
+ #not all currencies supported by fixer.io. So we need check them.
39
+ if rates.has_key?(to_currency.to_sym)
40
+ rate_string = rates[to_currency.to_sym]
41
+ result = rate_string.to_f
42
+ end
43
+
44
+ result
38
45
  end
39
46
 
40
47
  end
data/mrpin-sdk.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'mrpin-sdk'
7
- spec.version = '1.0.83'
7
+ spec.version = '1.0.84'
8
8
  spec.authors = %w(Gregory Tkach Yakupov Dmitrij)
9
9
  spec.email = %w(gregory.tkach@gmail.com yakupov.dmitrij@gmail.com)
10
10
  spec.description = %q{Mrpin sdk for backend development.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrpin-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.83
4
+ version: 1.0.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-09-04 00:00:00.000000000 Z
14
+ date: 2017-09-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler