Sha256: cf0c2dbc7f6292f61d166766ae7c5c630b456c95651808eccc8c0432dd7533d1

Contents?: true

Size: 471 Bytes

Versions: 2

Compression:

Stored size: 471 Bytes

Contents

require 'mtgox/bid'
require 'singleton'

module MtGox
  class MaxBid < Bid
    include Singleton
    attr_accessor :previous_price

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

    def up?
      price > previous_price.to_f
    end

    def down?
      price < previous_price.to_f
    end

    def changed?
      price != previous_price.to_f
    end

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mtgox-0.5.1 lib/mtgox/max_bid.rb
mtgox-0.5.0 lib/mtgox/max_bid.rb