Class: ChinaShop::MarketDepth

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(depth = {}) ⇒ MarketDepth

Returns a new instance of MarketDepth.



5
6
7
8
9
# File 'lib/chinashop/market_depth.rb', line 5

def initialize(depth = {})
  self.all  = depth['result']['market_depth']
  self.bids = depth['result']['market_depth']['bid']
  self.asks = depth['result']['market_depth']['ask']
end

Instance Attribute Details

#allObject

Returns the value of attribute all.



3
4
5
# File 'lib/chinashop/market_depth.rb', line 3

def all
  @all
end

#asksObject

Returns the value of attribute asks.



3
4
5
# File 'lib/chinashop/market_depth.rb', line 3

def asks
  @asks
end

#bidsObject

Returns the value of attribute bids.



3
4
5
# File 'lib/chinashop/market_depth.rb', line 3

def bids
  @bids
end