cryptocoincharts_ruby 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/cryptocoincharts_ruby.rb +12 -12
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTA5M2U3NDg1YWFmMTRiYTYzNmNkNjgzODliYjI1MWU0Y2IyMmViYg==
4
+ ZmE0Yzg5M2ViMGI3MWVlOWIyYTNlZTU3YTllY2I1MTZkZmQxMGYyNw==
5
5
  data.tar.gz: !binary |-
6
- ODZjNTBjYmNjZDUyNGM0OGRmMzE4MTcyMTczNjgxMzNiOWYyOThmZQ==
6
+ MWI3NGVjNzhkOGE0ZGM3MTNhY2IwZjUzNDg2YjEyOWU3ODdhNDY3OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzI0YTNlMzZhYjU0N2M3ZjUzMDhhYWQ0MDc5YWNiZjAxOWFiZGNiZGU1Yzdl
10
- NGJiOTQzNWJiZjUwNzFjMzNhNDRkYTQ2YWU4YTdlNzAxNWU5OGE1NDc0OTQ5
11
- MDE5MzA5OWUzNmRkNDRiYTBhOTA0MGI3NjZlZTQ5NTZkZTI0M2Y=
9
+ NmYzMTAzYmI3MDU0NTMzNGM2ZGRhN2E3NjY1NTM4MjI1MWRjZTBiNzRkYmY2
10
+ MTAwZWQxMDEwNzIxYjJkYjVlNzMyMDMxMTRjNGVkMzJiMjFhOTdiM2ZiMTQz
11
+ MTliMDNhMjAzODdhNTU5N2Y0NWM5YmU5MzhlNjU0MjliYzNhMmE=
12
12
  data.tar.gz: !binary |-
13
- Mzc1MjM0NjM0NzllZDU1ZDg4MWRhM2Q1MmU5NGY1MWExZTNlOWQ5ODczYWQ3
14
- ZTg3ZGUyMWY4M2MwNGQ3ZjdjNGRlOTM0YWQzMjczNmMxNGIyNDc2ODYzOGEz
15
- YjdhZDI5NzgzZjZjODIxYmZkZTcxZGYxMmMxNDY0ZTlkNGFiMDQ=
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.15'
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.code}_btc".to_sym)
51
- puts "WARNING: Valid coin pair #{coin.code}_btc does not appear in the list of valid pairs!"
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 :code, :from => :id, :with => lambda {|v| v.to_sym }
83
+ property :id, :transform_with => lambda {|v| v.to_sym }
84
84
  property :name
85
85
  property :website
86
- property :btc_value, :from => :price_btc, :with => lambda {|v| BigDecimal.new(v) }
87
- property :btc_volume_24h, :from => :volume_btc, :with => lambda {|v| v.to_f }
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 :code, :from => :id, :with => lambda {|v| v.gsub!(/\//, '_').to_sym }
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 :btc_value, :from => :price, :with => lambda {|v| BigDecimal.new(v) }
95
- property :btc_value_24h_ago, :from => :price_before_24h, :with => lambda {|v| BigDecimal.new(v) }
96
- property :btc_volume, :from => :volume_btc, :with => lambda {|v| v.to_f }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptocoincharts_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Barron