Class: Excoin::Market::Exchange::OrderDepthChart
- Inherits:
-
Object
- Object
- Excoin::Market::Exchange::OrderDepthChart
- Defined in:
- lib/exchange/order_depth_chart.rb
Defined Under Namespace
Classes: DataPoint
Instance Attribute Summary collapse
-
#ask_orders ⇒ Object
readonly
Returns the value of attribute ask_orders.
-
#bid_orders ⇒ Object
readonly
Returns the value of attribute bid_orders.
-
#commodity ⇒ Object
readonly
Returns the value of attribute commodity.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #exchange ⇒ Object
-
#initialize(exchange_name) ⇒ OrderDepthChart
constructor
A new instance of OrderDepthChart.
- #update ⇒ Object
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_orders ⇒ Object (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_orders ⇒ Object (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 |
#commodity ⇒ Object (readonly)
Returns the value of attribute commodity.
2 3 4 |
# File 'lib/exchange/order_depth_chart.rb', line 2 def commodity @commodity end |
#currency ⇒ Object (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
#exchange ⇒ Object
19 20 21 |
# File 'lib/exchange/order_depth_chart.rb', line 19 def exchange return Excoin.market.exchange(@exchange_name) end |
#update ⇒ Object
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 |