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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ae43131b099eed65bb04af747c645194237d2381e164578d663a40407d11f52
4
- data.tar.gz: 96a40a3cfd66b9a649bc5dcdee633a54fb89a6f41497ee6ccd0065a5a3048a3c
3
+ metadata.gz: 9c53cd739f292d46b462b70e99d93f3797f41df61758104293c77f4bf8573ffc
4
+ data.tar.gz: 382045e0d812adeb655fe084bb13463c9f7bb688081ec406a91d98815f55b494
5
5
  SHA512:
6
- metadata.gz: f7d4da86ee07d734c03813c288bcdeabff2d948b8fb8a0a56d0263a0bfba2b73e27b3ae38adaf3f1725cb2db0c4ce84735830225017d52c1f03c1100bd8601bc
7
- data.tar.gz: 7b76091240025a5af2eef158fe6a691d34503feeb50db249ab369e5d6cc805f62d6d17b3af2f5d3754207641b6b1500b6aedd4ceb4eec7899268913276238617
6
+ metadata.gz: c4fc3365c86ac13ead56a1bf3dae0dc0a57072c7806ba23d2196ff5fa9165a8afcb70dd676789a0abb0d9b8d97ae86bf24b406fbca36efaf74453754c5a3d4a3
7
+ data.tar.gz: '096fe84138e2fde1b9b082658d7c6748bd8ffa4602f3de6b7e56270e78a75ced9b513da9ff35ecbc9becaf5e6eddcb6952c8365338a216e3a40feedcaf71e5c0'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- currency_quote (0.1.1)
4
+ currency_quote (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- quote = data[index + 1].gsub(",", ".").to_f
38
- quote = 1 if quote == 0
39
- @sell = (dolar.sell * quote).to_f
40
- @buy = (dolar.buy * quote).to_f
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
@@ -1,3 +1,3 @@
1
1
  module CurrencyQuote
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: currency_quote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo A. Díaz Martínez