Sha256: 74d15cfa46debc67cd4213603b1b7b5d96c31dc2dcc05517fefd5b6ebd6baa90

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

require 'mtgox/models/offer'

module MtGox
  module Models
    class Trade < Offer

      prop :type, #        "trade"
           :item, #        "BTC"
           :price_currency, # "USD"
           :trade_type, #     "ask", "
           :primary, # "Y" or "N", the primary currency is always the buyers currency
           :properties, #  "limit,mixed_currency"
           :amount_int, # "1067215400"
           :price_int, #   681526"
           :amount => :f, #  10.672154
           :price => :f, #   6.81526
           [:id, :tid] => :i, #  "tid"=>"1326655184087854"
           :date => proc { |val| Time.at val } # 1326655184

      def to_s
        "<Trade: #{@date.strftime('%H:%M:%S')} #{ amount.round(3) } at #{ price.round(3) }"
      end

      def to_s
        "<Trade: #{ amount.round(3) } at #{ price.round(3) }"+
            " #{price_currency}/#{item} (#{trade_type}) - #{ properties } #{ primary } >"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mt_gox-0.7.5 lib/mtgox/models/trade.rb