mrpin-sdk 1.0.82 → 1.0.83

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: 7950602e399b216de3404fd5389c699942cfd793
4
- data.tar.gz: 58e89a1ae5187e789a4dc9a5aa00e6b0945a7a9a
3
+ metadata.gz: 73e96429e6ca3d2b59feed79c4af902e2096cb48
4
+ data.tar.gz: ba88b3bc0a99d8d6b61b9ce282c0db3f43a0db00
5
5
  SHA512:
6
- metadata.gz: 4958ca66903261b778e13976db0fc8240b89e87d2a97dfd1067e84ca8ad03d6cade92866b5efcad5d7dd685ad37b1c8fd03819b157c1da47bd59ba3256c39af4
7
- data.tar.gz: ea754f014de8bffbb5ffe44f70497224d774ede25c10b2fa99249dc470999d6e314d94ded26f5b395199e4a9d64782df4434c7d46f4e567b35b9c723a5034d51
6
+ metadata.gz: a96c7fd114932531aa8e0b6929d02c456aafcf2bf802bdb88e839d28d782fd70ef6200a82514a2328b486881d2b626079dc0578aa21463a17a860d208e98df1c
7
+ data.tar.gz: fdb6165523c4f8c8086938d839512c59a22e47a4d7f38c1dcbbc19b2f5195412a6de5b8d879cc6000923c93fc351b4811a4c080e6dd6ad47112ace876302d4d7
@@ -5,7 +5,8 @@ class CurrencyExchanger
5
5
 
6
6
  @exchanger_local = ExchangerLocal.new
7
7
 
8
- @exchangers << ExchangerYahoo.new
8
+ @exchangers << ExchangerYahoo0.new
9
+ @exchangers << ExchangerYahoo1.new
9
10
  @exchangers << ExchangerFixer.new
10
11
 
11
12
  end
@@ -0,0 +1,39 @@
1
+ class ExchangerYahoo0 < ExchangerBase
2
+
3
+ #
4
+ # properties
5
+ #
6
+
7
+ #
8
+ # methods
9
+ #
10
+
11
+ # default constructor
12
+ public
13
+ def initialize
14
+ super
15
+ @exchanger_api = ManagerRemoteHttp.new(url: 'https://quote.yahoo.com')
16
+ end
17
+
18
+
19
+ public
20
+ def get_rate(from_currency, to_currency)
21
+ params =
22
+ {
23
+ s: "#{from_currency}#{to_currency}=X",
24
+ f: 'l1',
25
+ e: '.csv'
26
+ }
27
+
28
+ response = @exchanger_api.get('d/quotes.csv', params)
29
+
30
+ assert(response[:status] == EResponseType::ERT_OK, response)
31
+
32
+ rate_string = response[:response]
33
+
34
+ rate_string.strip!
35
+
36
+ rate_string.to_f
37
+ end
38
+
39
+ end
@@ -1,4 +1,4 @@
1
- class ExchangerYahoo < ExchangerBase
1
+ class ExchangerYahoo1 < ExchangerBase
2
2
 
3
3
 
4
4
  # default constructor
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.82'
7
+ spec.version = '1.0.83'
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.82
4
+ version: 1.0.83
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-08-17 00:00:00.000000000 Z
14
+ date: 2017-09-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -400,7 +400,8 @@ files:
400
400
  - lib/mrpin/core/currency_exchanger/currency_exchanger.rb
401
401
  - lib/mrpin/core/currency_exchanger/fixer/exchanger_fixer.rb
402
402
  - lib/mrpin/core/currency_exchanger/local/exchanger_local.rb
403
- - lib/mrpin/core/currency_exchanger/yahoo/exchanger_yahoo.rb
403
+ - lib/mrpin/core/currency_exchanger/yahoo/exchanger_yahoo0.rb
404
+ - lib/mrpin/core/currency_exchanger/yahoo/exchanger_yahoo1.rb
404
405
  - lib/mrpin/core/error/error_server_base.rb
405
406
  - lib/mrpin/core/exceptions/assertion_error.rb
406
407
  - lib/mrpin/core/extensions/hash.rb