Module: MtGox::PriceTicker

Included in:
Models::MaxBid, Models::MinAsk, Models::MultiTicker, Models::Ticker
Defined in:
lib/mtgox/price_ticker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#previous_priceObject (readonly)

Returns the value of attribute previous_price.



3
4
5
# File 'lib/mtgox/price_ticker.rb', line 3

def previous_price
  @previous_price
end

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/mtgox/price_ticker.rb', line 3

def price
  @price
end

Instance Method Details

#changed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/mtgox/price_ticker.rb', line 18

def changed?
  price.to_f != previous_price.to_f
end

#down?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/mtgox/price_ticker.rb', line 14

def down?
  price.to_f < previous_price.to_f
end

#unchanged?Boolean Also known as: unch?

Returns:

  • (Boolean)


22
23
24
# File 'lib/mtgox/price_ticker.rb', line 22

def unchanged?
  !changed?
end

#up?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mtgox/price_ticker.rb', line 10

def up?
  price.to_f > previous_price.to_f
end