cryptocoincharts_ruby 0.0.15 → 0.0.16
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 +8 -8
- data/lib/cryptocoincharts_ruby.rb +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmE0Yzg5M2ViMGI3MWVlOWIyYTNlZTU3YTllY2I1MTZkZmQxMGYyNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWI3NGVjNzhkOGE0ZGM3MTNhY2IwZjUzNDg2YjEyOWU3ODdhNDY3OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmYzMTAzYmI3MDU0NTMzNGM2ZGRhN2E3NjY1NTM4MjI1MWRjZTBiNzRkYmY2
|
10
|
+
MTAwZWQxMDEwNzIxYjJkYjVlNzMyMDMxMTRjNGVkMzJiMjFhOTdiM2ZiMTQz
|
11
|
+
MTliMDNhMjAzODdhNTU5N2Y0NWM5YmU5MzhlNjU0MjliYzNhMmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzFiNjdlNTg4MjExNjI2ZTE3YWI1MjFmNzFmN2JkNjc2ZDMwNTEyZmVmMDlk
|
14
|
+
ODllMDk1YTRhYTg5ZDVhYWJlZjk1NTA4YThmOTRjNzQxODg2MDI0NmRjMTQ4
|
15
|
+
MTRlNWVlMjBiNmQ4ZTdmOTBhMDVjNDY5NWVhYjdjNDJhMDQ1Zjk=
|
@@ -6,7 +6,7 @@ require 'bigdecimal'
|
|
6
6
|
module CryptoCoinCharts
|
7
7
|
class << self
|
8
8
|
|
9
|
-
VERSION = '0.0.
|
9
|
+
VERSION = '0.0.16'
|
10
10
|
|
11
11
|
API_URL = 'http://www.cryptocoincharts.info/v2/api'
|
12
12
|
VALID_PAIRS = [
|
@@ -31,9 +31,9 @@ module CryptoCoinCharts
|
|
31
31
|
:mxb_btc, :myr_btc, :mzc_btc, :nan_btc, :nbl_btc, :nec_btc, :net_btc, :nib_btc, :nka_btc, :nmc_btc,
|
32
32
|
:nobl_btc, :nok_btc, :nrb_btc, :nrs_btc, :nvc_btc, :nwc_btc, :nxt_btc, :nyan_btc, :nym_btc, :ogc_btc,
|
33
33
|
:oly_btc, :orb_btc, :osc_btc, :pand_btc, :panda_btc, :pawn_btc, :pcc_btc, :peng_btc, :pho_btc, :phs_btc,
|
34
|
-
:pi_btc, :pig_btc, :plc_btc, :plnc_btc, :pmc_btc, :points_btc, :pop_btc, :pot_btc, :ppc_btc, :ppl_btc,
|
34
|
+
:pi_btc, :pig_btc, :plc_btc, :plnc_btc, :pmc_btc, :pnd_btc, :points_btc, :pop_btc, :pot_btc, :ppc_btc, :ppl_btc,
|
35
35
|
:prc_btc, :prt_btc, :pt_btc, :pts_btc, :pwc_btc, :pxc_btc, :pxl_btc, :pyc_btc, :q2c_btc, :qqc_btc, :qrk_btc,
|
36
|
-
:rch_btc, :rdd_btc, :rec_btc, :red_btc, :redd_btc, :ric_btc, :rpc_btc, :rpd_btc, :rqc_btc, :rt2_btc, :ruby_btc,
|
36
|
+
:rbbt_btc, :rch_btc, :rdd_btc, :rec_btc, :red_btc, :redd_btc, :ric_btc, :rpc_btc, :rpd_btc, :rqc_btc, :rt2_btc, :ruby_btc,
|
37
37
|
:rur_btc, :ryc_btc, :sat_btc, :sav_btc, :sbc_btc, :sc_btc, :skc_btc, :sll_btc, :sloth_btc, :slr_btc, :smc_btc,
|
38
38
|
:soc_btc, :spa_btc, :spt_btc, :src_btc, :stc_btc, :str_btc, :sun_btc, :svc_btc, :sxc_btc, :syn_btc, :tag_btc,
|
39
39
|
:tak_btc, :tea_btc, :tek_btc, :tes_btc, :tgc_btc, :tips_btc, :tix_btc, :top_btc, :trc_btc, :trl_btc, :ttc_btc,
|
@@ -47,8 +47,8 @@ module CryptoCoinCharts
|
|
47
47
|
coins.map! {|c| CoinSummary.new(c) rescue nil }
|
48
48
|
coins.delete(nil)
|
49
49
|
coins.each do |coin|
|
50
|
-
if !VALID_PAIRS.include?("#{coin.
|
51
|
-
puts "WARNING: Valid coin pair #{coin.
|
50
|
+
if !VALID_PAIRS.include?("#{coin.id}_btc".to_sym)
|
51
|
+
puts "WARNING: Valid coin pair #{coin.id}_btc does not appear in the list of valid pairs!"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
coins
|
@@ -80,20 +80,20 @@ module CryptoCoinCharts
|
|
80
80
|
end
|
81
81
|
|
82
82
|
class CoinSummary < Hashie::Trash
|
83
|
-
property :
|
83
|
+
property :id, :transform_with => lambda {|v| v.to_sym }
|
84
84
|
property :name
|
85
85
|
property :website
|
86
|
-
property :
|
87
|
-
property :
|
86
|
+
property :price_btc, :transform_with => lambda {|v| BigDecimal.new(v) }
|
87
|
+
property :volume_btc, :transform_with => lambda {|v| v.to_f }
|
88
88
|
end
|
89
89
|
|
90
90
|
class CoinDetail < Hashie::Trash
|
91
|
-
property :
|
91
|
+
property :id, :transform_with => lambda {|v| v.gsub!(/\//, '_').to_sym }
|
92
92
|
property :best_market
|
93
93
|
property :latest_trade, :transform_with => lambda {|v| Time.parse(v) rescue v }
|
94
|
-
property :
|
95
|
-
property :
|
96
|
-
property :
|
94
|
+
property :price, :transform_with => lambda {|v| BigDecimal.new(v) }
|
95
|
+
property :price_before_24h, :transform_with => lambda {|v| BigDecimal.new(v) }
|
96
|
+
property :volume_btc, :transform_with => lambda {|v| v.to_f }
|
97
97
|
property :volume_first, :transform_with => lambda {|v| v.to_f }
|
98
98
|
property :volume_second, :transform_with => lambda {|v| v.to_f }
|
99
99
|
end
|