Class: Bitstamp::Ticker

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

Instance Attribute Summary collapse

Attributes inherited from Model

#error, #message

Class Method Summary collapse

Methods inherited from Model

#attributes, #attributes=, #initialize

Constructor Details

This class inherits a constructor from Bitstamp::Model

Instance Attribute Details

#askObject

Returns the value of attribute ask.



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

def ask
  @ask
end

#bidObject

Returns the value of attribute bid.



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

def bid
  @bid
end

#highObject

Returns the value of attribute high.



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

def high
  @high
end

#lastObject

Returns the value of attribute last.



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

def last
  @last
end

#lowObject

Returns the value of attribute low.



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

def low
  @low
end

#timestampObject

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#volumeObject

Returns the value of attribute volume.



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

def volume
  @volume
end

#vwapObject

Returns the value of attribute vwap.



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

def vwap
  @vwap
end

Class Method Details

.from_apiObject



5
6
7
# File 'lib/bitstamp/ticker.rb', line 5

def self.from_api
  Bitstamp::Helper.parse_object!(Bitstamp::Net.get('/ticker').body_str, self)
end

.method_missing(method, *args) ⇒ Object



9
10
11
12
13
14
# File 'lib/bitstamp/ticker.rb', line 9

def self.method_missing method, *args
  ticker = self.from_api
  return ticker.send(method) if ticker.respond_to? method

  super
end