Class: ChinaShop::Ticker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#allObject

Returns the value of attribute all.



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

def all
  @all
end

#buyObject

Returns the value of attribute buy.



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

def buy
  @buy
end

#highObject

Returns the value of attribute high.



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

def high
  @high
end

#lastObject

Returns the value of attribute last.



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

def last
  @last
end

#lowObject

Returns the value of attribute low.



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

def low
  @low
end

#sellObject

Returns the value of attribute sell.



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

def sell
  @sell
end

#volObject

Returns the value of attribute vol.



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

def vol
  @vol
end