money-coinmarketcap-bank 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/lib/money/bank/coin_market_cap.rb +6 -5
- data/money-coinmarketcap-bank.gemspec +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee21fe1a7437cdd09b1c5d329b54e59b9e6c3158
|
4
|
+
data.tar.gz: 3941adddb496555702b63ccd6276d5188e59e902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48dd8bcd993544bb4074dc7afefdefa9af74bb57cd8debb9fbde5494a81eab60374dea2bec1286ffb647a548df699a0c54aa6335dae1b3aa1ee07d6bd1c7eccd
|
7
|
+
data.tar.gz: 21b90d74f9206e619c746323e4238df86c2e783334ec6ffa4b347f1732821c1cb8bd13af71a6e44836ea5ba86b92bfbec449f786d8ed225c9074f0973a3b1e71
|
@@ -6,15 +6,12 @@ require "json"
|
|
6
6
|
class Money
|
7
7
|
module Bank
|
8
8
|
class CoinMarketCap < Money::Bank::VariableExchange
|
9
|
-
BASE_CURRENCY = "
|
9
|
+
BASE_CURRENCY = "BTC".freeze
|
10
10
|
EXCHANGE_URL = "http://coinmarketcap.northpole.ro/api/v5/all.json".freeze
|
11
11
|
|
12
12
|
# Seconds after which the current rates are automatically expired
|
13
13
|
attr_accessor :ttl_in_seconds
|
14
14
|
|
15
|
-
# Parsed UpholdBank result as a Hash
|
16
|
-
attr_reader :tickers
|
17
|
-
|
18
15
|
# Rates expiration time
|
19
16
|
attr_reader :rates_expire_at
|
20
17
|
|
@@ -67,11 +64,15 @@ class Money
|
|
67
64
|
|
68
65
|
def add_exchange_rates
|
69
66
|
currencies.each do |currency|
|
67
|
+
next if currency['availableSupplyNumber'] == 0
|
68
|
+
|
70
69
|
iso_from = currency['symbol']
|
71
70
|
currency['price'].each do |iso_to, rate|
|
71
|
+
iso_to = iso_to.upcase
|
72
72
|
next unless Money::Currency.find(iso_from) && Money::Currency.find(iso_to)
|
73
|
+
|
73
74
|
add_rate(iso_from, iso_to, rate)
|
74
|
-
add_rate(iso_to, iso_from, 1.0 / rate)
|
75
|
+
add_rate(iso_to, iso_from, 1.0 / rate) rescue binding.pry
|
75
76
|
end
|
76
77
|
end
|
77
78
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-coinmarketcap-bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '6.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '12.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '12.0'
|
41
41
|
description: Attach this gem to ruby-money to use it as bank and get the exchange
|
@@ -45,7 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
-
|
48
|
+
- .gitignore
|
49
49
|
- README.md
|
50
50
|
- Rakefile
|
51
51
|
- lib/money/bank/coin_market_cap.rb
|
@@ -60,17 +60,17 @@ require_paths:
|
|
60
60
|
- lib
|
61
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - '>='
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '>='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
73
|
+
rubygems_version: 2.0.14.1
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: CoinMarketCap frontend for ruby-money
|