Class: Excoin::Market::Exchange::OrderDepthChart

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

Defined Under Namespace

Classes: DataPoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exchange_name) ⇒ OrderDepthChart



4
5
6
7
8
9
10
11
# File 'lib/exchange/order_depth_chart.rb', line 4

def initialize(exchange_name)
  @exchange_name = exchange_name
  exchange = self.exchange

  @currency = exchange.currency
  @commodity = exchange.commodity
  self.update
end

Instance Attribute Details

#ask_ordersObject (readonly)

Returns the value of attribute ask_orders.



2
3
4
# File 'lib/exchange/order_depth_chart.rb', line 2

def ask_orders
  @ask_orders
end

#bid_ordersObject (readonly)

Returns the value of attribute bid_orders.



2
3
4
# File 'lib/exchange/order_depth_chart.rb', line 2

def bid_orders
  @bid_orders
end

#commodityObject (readonly)

Returns the value of attribute commodity.



2
3
4
# File 'lib/exchange/order_depth_chart.rb', line 2

def commodity
  @commodity
end

#currencyObject (readonly)

Returns the value of attribute currency.



2
3
4
# File 'lib/exchange/order_depth_chart.rb', line 2

def currency
  @currency
end

Instance Method Details

#exchangeObject



19
20
21
# File 'lib/exchange/order_depth_chart.rb', line 19

def exchange
  return Excoin.market.exchange(@exchange_name)
end

#updateObject



13
14
15
16
17
# File 'lib/exchange/order_depth_chart.rb', line 13

def update
  @bid_orders = Array.new
  @ask_orders = Array.new
  self.populate_orders
end