<commit_before>require 'orders/order_book'
require 'orders/booked_list'

module Orders
  # Represents list of ALL Orders, indexed by id (replId)
  # Its @books is a set of OrderBooks by isin. Each OrderBook lists Orders by price.
  class OrderList < BookedList

    def initialize
      super Orders::OrderBook
    end

    def index item
      item.id
    end
  end
end<commit_msg>EventedDataStream slimmed down, RevisionTracking and FileSaving mixins extracted<commit_after>require 'orders/order_book'
require 'orders/booked_list'

module Orders
  # Represents list of ALL Orders, indexed by id (replId)
  # Its @books is a set of OrderBooks by isin. Each OrderBook lists Orders by price.
  class OrderList < BookedList

    def initialize
      super Orders::OrderBook
    end

    def index item
      item.id
    end

    def add_record(rec)
      isin_id = rec.GetValAsLong('isin_id')
      order = Orders::Order.new :isin_id => isin_id,
                                :id => rec.GetValAsString('replID').to_i,
                                :rev => rec.GetValAsString('replRev').to_i,
                                :price => rec.GetValAsString('price').to_f,
                                :volume => rec.GetValAsString('volume').to_f,
                                :dir => rec.GetValAsLong('dir')
      add? order
    end

  end
end
{'fraction_non_alphanumeric': 0.0801781737193764, 'fraction_numerical': 0.0, 'mean_word_length': 2.22488038277512, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6477644', 'n_tokens_mistral': 420, 'n_tokens_neox': 392, 'n_words': 117}