Class: ChinaShop::MarketDepth
- Inherits:
-
Object
- Object
- ChinaShop::MarketDepth
- Defined in:
- lib/chinashop/market_depth.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
Returns the value of attribute all.
-
#asks ⇒ Object
Returns the value of attribute asks.
-
#bids ⇒ Object
Returns the value of attribute bids.
Instance Method Summary collapse
-
#initialize(depth = {}) ⇒ MarketDepth
constructor
A new instance of MarketDepth.
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
#all ⇒ Object
Returns the value of attribute all.
3 4 5 |
# File 'lib/chinashop/market_depth.rb', line 3 def all @all end |
#asks ⇒ Object
Returns the value of attribute asks.
3 4 5 |
# File 'lib/chinashop/market_depth.rb', line 3 def asks @asks end |
#bids ⇒ Object
Returns the value of attribute bids.
3 4 5 |
# File 'lib/chinashop/market_depth.rb', line 3 def bids @bids end |