Class: Coinone::Public::Orderbook

Inherits:
Object
  • Object
show all
Defined in:
lib/coinone/public/orderbook.rb,
lib/coinone/public/orderbook/order.rb,
lib/coinone/public/orderbook/orders.rb

Defined Under Namespace

Classes: Order, Orders

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Orderbook

Returns a new instance of Orderbook.



8
9
10
11
12
13
# File 'lib/coinone/public/orderbook.rb', line 8

def initialize(params={})
  @ask = Orders.new(params[:ask]) || []
  @bid = Orders.new(params[:bid]) || []
  @timestamp = params[:timestamp].to_i || nil
  @currency= params[:currency] || nil
end

Instance Attribute Details

#askObject (readonly)

Returns the value of attribute ask.



6
7
8
# File 'lib/coinone/public/orderbook.rb', line 6

def ask
  @ask
end

#bidObject (readonly)

Returns the value of attribute bid.



6
7
8
# File 'lib/coinone/public/orderbook.rb', line 6

def bid
  @bid
end

#currencyObject (readonly)

Returns the value of attribute currency.



6
7
8
# File 'lib/coinone/public/orderbook.rb', line 6

def currency
  @currency
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



6
7
8
# File 'lib/coinone/public/orderbook.rb', line 6

def timestamp
  @timestamp
end