Sha256: 0559a9783a625b9c05022b2c2f844a632245902473200923aeffd399bbb465bc

Contents?: true

Size: 428 Bytes

Versions: 15

Compression:

Stored size: 428 Bytes

Contents

module MtGox
  module PriceTicker
    attr_reader :previous_price, :price

    def price=(price)
      @previous_price = @price
      @price = price
    end

    def up?
      price.to_f > previous_price.to_f
    end

    def down?
      price.to_f < previous_price.to_f
    end

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

    def unchanged?
      !changed?
    end
    alias :unch? :unchanged?
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
mtgox-0.9.1 lib/mtgox/price_ticker.rb
mtgox-0.9.0 lib/mtgox/price_ticker.rb
mtgox-0.8.2 lib/mtgox/price_ticker.rb
mtgox-0.8.1 lib/mtgox/price_ticker.rb
mtgox-0.8.0 lib/mtgox/price_ticker.rb
mtgox-0.7.5 lib/mtgox/price_ticker.rb
mtgox-0.7.4 lib/mtgox/price_ticker.rb
mtgox-0.7.3 lib/mtgox/price_ticker.rb
mt_gox-0.7.7 lib/mtgox/price_ticker.rb
mt_gox-0.7.6 lib/mtgox/price_ticker.rb
mt_gox-0.7.5 lib/mtgox/price_ticker.rb
mt_gox-0.7.3 lib/mtgox/price_ticker.rb
mtgox-0.7.2 lib/mtgox/price_ticker.rb
mtgox-0.7.1 lib/mtgox/price_ticker.rb
mtgox-0.7.0 lib/mtgox/price_ticker.rb