Module: MtGox::PriceTicker

Included in:
MaxBid, MinAsk, 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.



5
6
7
# File 'lib/mtgox/price_ticker.rb', line 5

def previous_price
  @previous_price
end

#priceObject

Returns the value of attribute price.



5
6
7
# File 'lib/mtgox/price_ticker.rb', line 5

def price
  @price
end

Instance Method Details

#changed?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/mtgox/price_ticker.rb', line 20

def changed?
  BigDecimal(price.to_s) != BigDecimal(previous_price.to_s)
end

#down?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/mtgox/price_ticker.rb', line 16

def down?
  BigDecimal(price.to_s) < BigDecimal(previous_price.to_s)
end

#unchanged?Boolean Also known as: unch?

Returns:

  • (Boolean)


24
25
26
# File 'lib/mtgox/price_ticker.rb', line 24

def unchanged?
  !changed?
end

#up?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/mtgox/price_ticker.rb', line 12

def up?
  BigDecimal(price.to_s) > BigDecimal(previous_price.to_s)
end