Sha256: 3d1789b1c0f4ada96ef8c6c3764b1dc179cd02cb8a370f1e0100be8253727464

Contents?: true

Size: 765 Bytes

Versions: 1

Compression:

Stored size: 765 Bytes

Contents

module Orders
  # Represents single price level for OrderBook for one security
  # (aggregate bid or ask with aggregate volume)
  #      // элемент "строка в стакане"
  #      tOrderBookItem  = record
  #        id         : int64;
  #        rev        : int64;
  #        price         : double;  // цена
  #        volume        : double;  // кол-во
  #        buysell       : longint; // покупка(1)/продажа(2)
  #        order_book      : tOrderBook;
  class OrderBookItem
    attr_accessor :isin_id, :id, :rev, :price, :volume, :buysell, :order_book

    def initialize opts = {}
      opts.each {|key, value| send "#{key}=", value}
    end

    def inspect
      "#{id}:#{price}>#{volume}#{buysell == 1 ? '+' : '-'}"
    end

    alias to_s inspect
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
orders-0.0.4 lib/orders/order_book_item.rb