Class: Btce::Ticker

Inherits:
PublicOperation show all
Defined in:
lib/btce.rb

Constant Summary collapse

JSON_METHODS =
%w(high low avg vol vol_cur last buy sell server_time)

Instance Attribute Summary

Attributes inherited from PublicOperation

#json, #operation, #pair

Instance Method Summary collapse

Methods inherited from PublicOperation

#load_json

Constructor Details

#initialize(pair) ⇒ Ticker

Returns a new instance of Ticker.



164
165
166
# File 'lib/btce.rb', line 164

def initialize(pair)
  super 'ticker', pair
end

Instance Method Details

#spreadObject



185
186
187
# File 'lib/btce.rb', line 185

def spread
  (offer - bid) / offer
end

#spread_percentObject



189
190
191
# File 'lib/btce.rb', line 189

def spread_percent
  spread * 100.0
end