Class: ChinaShop::Ticker
- Inherits:
-
Object
- Object
- ChinaShop::Ticker
- Defined in:
- lib/chinashop/ticker.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
Returns the value of attribute all.
-
#buy ⇒ Object
Returns the value of attribute buy.
-
#high ⇒ Object
Returns the value of attribute high.
-
#last ⇒ Object
Returns the value of attribute last.
-
#low ⇒ Object
Returns the value of attribute low.
-
#sell ⇒ Object
Returns the value of attribute sell.
-
#vol ⇒ Object
Returns the value of attribute vol.
Instance Method Summary collapse
-
#initialize(ticker = {}) ⇒ Ticker
constructor
A new instance of Ticker.
Constructor Details
#initialize(ticker = {}) ⇒ Ticker
Returns a new instance of Ticker.
5 6 7 8 9 10 11 12 13 |
# File 'lib/chinashop/ticker.rb', line 5 def initialize(ticker = {}) self.all = ticker['ticker'] self.high = ticker['ticker']['high'] self.low = ticker['ticker']['low'] self.buy = ticker['ticker']['buy'] self.sell = ticker['ticker']['sell'] self.last = ticker['ticker']['last'] self.vol = ticker['ticker']['vol'] end |
Instance Attribute Details
#all ⇒ Object
Returns the value of attribute all.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def all @all end |
#buy ⇒ Object
Returns the value of attribute buy.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def buy @buy end |
#high ⇒ Object
Returns the value of attribute high.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def high @high end |
#last ⇒ Object
Returns the value of attribute last.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def last @last end |
#low ⇒ Object
Returns the value of attribute low.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def low @low end |
#sell ⇒ Object
Returns the value of attribute sell.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def sell @sell end |
#vol ⇒ Object
Returns the value of attribute vol.
3 4 5 |
# File 'lib/chinashop/ticker.rb', line 3 def vol @vol end |