hg-finance 1.0.1 → 1.0.2

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: 6f8ffbd0d3bfd32653d773159cfd50288426c47d
4
- data.tar.gz: c336027e36d2347e03736e956b021b122be4e4cd
3
+ metadata.gz: f3c71f87ff309b70afc7019807f2acb0d6b1a60f
4
+ data.tar.gz: 3a7e28ccbd52dfadcec4a7e322b023b72a98e6d7
5
5
  SHA512:
6
- metadata.gz: 751156c1915288f8bf1be63c5e24d7b551dff9fefcaa5a9a0ea6e122c15325d70c4cfb58400aa5fc257cb21a59ecc75d3b81047473dc3a46d1c8ecc12046daac
7
- data.tar.gz: ab3c7651daa47b85e1af34adf9cfd680fa4e06a0480c5e2bd9cefc6c2c92a9f6c03449b56ed917253e57e51099cdcb1cb7e491978cc17921d8348bd25ff8a2b4
6
+ metadata.gz: 1375484b2cc70312c4b75313c853b0c95b85faa8af6c1a120086f77d42d881d8307a89bef2bb1dc2951d68fba2b9044572d0875fccd57120764782230dcadd20
7
+ data.tar.gz: 95ff8dac191344b69a540962dd7d02d7ff560bded3addeafb4fdcac3083d2beefb6318688a51c0df8778df5990ed26cfbf3141c1e588b67f21ab44d755d19688
@@ -26,19 +26,25 @@ module HG
26
26
  @taxes = Taxes.new(to_taxes(results['taxes'].first)) if @key_status == :valid
27
27
 
28
28
  @currencies = {}
29
- results['currencies'].each do |iso, currency|
30
- next if iso == 'source'
31
- @currencies[iso] = Currency.new(to_currency(currency, iso, results['currencies']['source']))
29
+ if results.has_key?('currencies')
30
+ results['currencies'].each do |iso, currency|
31
+ next if iso == 'source'
32
+ @currencies[iso] = Currency.new(to_currency(currency, iso, results['currencies']['source']))
33
+ end
32
34
  end
33
35
 
34
36
  @cryptocurrencies = {}
35
- results['bitcoin'].each do |exchange, c|
36
- @cryptocurrencies[exchange.to_sym] = { "btc#{c['format'][0]}".downcase.to_sym => CryptoCurrency.new(to_cryptocurrency(c, 'Bitcoin', 'BTC')) }
37
+ if results.has_key?('bitcoin')
38
+ results['bitcoin'].each do |exchange, c|
39
+ @cryptocurrencies[exchange.to_sym] = { "btc#{c['format'][0]}".downcase.to_sym => CryptoCurrency.new(to_cryptocurrency(c, 'Bitcoin', 'BTC')) }
40
+ end
37
41
  end
38
42
 
39
43
  @stocks = {}
40
- results['stocks'].each do |code, stock|
41
- @stocks[code] = Stock.new(to_stock(stock))
44
+ if results.has_key?('stocks')
45
+ results['stocks'].each do |code, stock|
46
+ @stocks[code] = Stock.new(to_stock(stock))
47
+ end
42
48
  end
43
49
  end
44
50
 
@@ -1,5 +1,5 @@
1
1
  module HG
2
2
  module Finance
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hg-finance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugo Demiglio