currency-exchange 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/currency_exchange/version.rb +1 -1
- data/lib/currency_exchange/xe.rb +3 -3
- 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: d03ace6e95724406737c1e1580336a6a217eafb8
|
4
|
+
data.tar.gz: 448fd6eaa2251e197e3131a6365dc18adee4137c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce4b4a8f137078379f8a8307479373a1ed66cac2d6cd3657e0ea3827d49e1a2cc08ab77882435e923b258649fdf10fa15f3c8e111b7948eef4fecbff00b2377f
|
7
|
+
data.tar.gz: 150d0d9c4af069887db10568f59dea3ac68f605a0ce96e9d427aefe810714d83505a63195e7a3d6d994f5f1c59bea8bf5d7785bc9575425d9707ebe105e79a1f
|
data/lib/currency_exchange/xe.rb
CHANGED
@@ -31,9 +31,9 @@ class CurrencyExchange::Xe
|
|
31
31
|
|
32
32
|
def self.parse_rate(doc)
|
33
33
|
exchange = doc.css('.uccResUnit').css('.leftCol')[0].inner_text
|
34
|
-
currency1, currency2 = exchange.split('
|
35
|
-
currency1 = currency1.split('
|
36
|
-
rate, currency2 = currency2.split('
|
34
|
+
currency1, currency2 = exchange.gsub(/[\u0080-\u00ff]/, ' ').split(' = ')
|
35
|
+
currency1 = currency1.split(' ').last
|
36
|
+
rate, currency2 = currency2.split(' ')
|
37
37
|
[currency1, currency2, rate]
|
38
38
|
end
|
39
39
|
private_class_method :request_rate, :query_builder, :parse_date, :parse_rate
|