Class: Btce::Ticker

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

Constant Summary collapse

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

Instance Attribute Summary

Attributes inherited from PublicOperation

#json, #operation, #options, #pair

Instance Method Summary collapse

Methods inherited from PublicOperation

#load_json

Constructor Details

#initialize(pair) ⇒ Ticker


39
40
41
# File 'lib/btce/api/operations/ticker.rb', line 39

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

Instance Method Details

#spreadObject


64
65
66
# File 'lib/btce/api/operations/ticker.rb', line 64

def spread
  (offer - bid) / offer
end

#spread_percentObject


68
69
70
# File 'lib/btce/api/operations/ticker.rb', line 68

def spread_percent
  spread * 100.0
end