Class: KoinimPrice::Orderbook

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

Constant Summary collapse

API_URL =
"#{KOINIM_URL}orderbook"

Class Method Summary collapse

Class Method Details

.asksObject



8
9
10
# File 'lib/koinim_price/orderbook.rb', line 8

def self.asks
  response['asks']
end

.bidsObject



12
13
14
# File 'lib/koinim_price/orderbook.rb', line 12

def self.bids
  response['bids']
end

.refreshObject



16
17
18
19
20
# File 'lib/koinim_price/orderbook.rb', line 16

def self.refresh
  @response = nil
  response
  true
end

.responseObject



22
23
24
# File 'lib/koinim_price/orderbook.rb', line 22

def self.response
  @response ||= JSON.parse(HTTParty.get(API_URL).body)
end