Top Level Namespace
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 |
# File 'lib/bithound.rb', line 4 def call bit_hound = open('http://api.bitcoincharts.com/v1/markets.json') response_status = bit_hound.status response_body = bit_hound.read @parsed_body = JSON.parse(response_body) end |
#display ⇒ Object
18 19 20 21 |
# File 'lib/bithound.rb', line 18 def display puts "okcoinCNY latest_trade = "+ @okcoinCNY.fetch("latest_trade").to_s puts "okcoinCNY close = " + @okcoinCNY.fetch("close").to_s end |
#find ⇒ Object
11 12 13 |
# File 'lib/bithound.rb', line 11 def find @parsed_body.detect {|market| market["symbol"] == "okcoinCNY"} end |