Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#callObject



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

#displayObject



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

#findObject



11
12
13
# File 'lib/bithound.rb', line 11

def find
  @parsed_body.detect {|market| market["symbol"] == "okcoinCNY"}
end