Class: CryptoTicker::Bitstamp

Inherits:
Object
  • Object
show all
Defined in:
lib/crypto_ticker.rb

Class Method Summary collapse

Class Method Details

.info(json) ⇒ Object



239
240
241
242
243
244
245
# File 'lib/crypto_ticker.rb', line 239

def info(json)
  info = {}
  JSON.parse(json).each do |k,v|
    info[k.to_sym] = v.to_d
  end
  info
end

.last(json) ⇒ Object



247
248
249
# File 'lib/crypto_ticker.rb', line 247

def last(json)
  self.info(json)[:last]
end

.ticker(base = 'BTC', quote = 'USD') ⇒ Object



235
236
237
# File 'lib/crypto_ticker.rb', line 235

def ticker(base='BTC', quote='USD')
  'https://www.bitstamp.net/api/ticker/'
end