currency_quote 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/currency_quote/currency.rb +8 -4
- data/lib/currency_quote/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c53cd739f292d46b462b70e99d93f3797f41df61758104293c77f4bf8573ffc
|
4
|
+
data.tar.gz: 382045e0d812adeb655fe084bb13463c9f7bb688081ec406a91d98815f55b494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4fc3365c86ac13ead56a1bf3dae0dc0a57072c7806ba23d2196ff5fa9165a8afcb70dd676789a0abb0d9b8d97ae86bf24b406fbca36efaf74453754c5a3d4a3
|
7
|
+
data.tar.gz: '096fe84138e2fde1b9b082658d7c6748bd8ffa4602f3de6b7e56270e78a75ced9b513da9ff35ecbc9becaf5e6eddcb6952c8365338a216e3a40feedcaf71e5c0'
|
data/Gemfile.lock
CHANGED
@@ -34,10 +34,14 @@ class CurrencyQuote::Currency
|
|
34
34
|
def get_currency_quotation
|
35
35
|
data = @doc.css("td").map(&:text).collect(&:strip!)
|
36
36
|
index = data.index(currency)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
if index
|
38
|
+
quote = data[index + 1].gsub(",", ".").to_f
|
39
|
+
quote = 1 if quote == 0
|
40
|
+
@sell = (dolar.sell * quote).to_f
|
41
|
+
@buy = (dolar.buy * quote).to_f
|
42
|
+
else
|
43
|
+
@sell = @buy = 0
|
44
|
+
end
|
41
45
|
end
|
42
46
|
|
43
47
|
def struct
|