<commit_before>module ROM
  class Session

    # @api private
    class Tracker
      attr_reader :objects, :changelog
      private :objects, :changelog

      class ObjectNotTrackedError < StandardError
        def initialize(object)
          super("Tracker doesn't include #{object.inspect}")
        end
      end

      # @api private
      def initialize
        @identity_map = Hash.new { |hash, key| hash[key] = IdentityMap.build }
        @objects      = Hash.new
        @changelog    = []
      end

      # @api private
      def commit
        @changelog.each { |state| update(state.commit) }
        @changelog = []
        self
      end

      # @api private
      def fetch(object)
        @objects.fetch(object.object_id) { raise ObjectNotTrackedError, object }
      end

      # @api private
      def include?(object)
        @objects.key?(object.object_id)
      end

      # @api private
      def queue(state)
        @changelog << state
        update(state)
      end

      # @api private
      def update(state)
        store(state.object, state)
      end

      # @api private
      def store(object, state)
        @objects[object.object_id] = state
        self
      end

      # @api private
      def store_transient(object)
        store(object, State::Transient.new(object))
      end

      # @api private
      def store_persisted(object, mapper)
        store(object, State::Persisted.new(object, mapper))
      end

      # @api private
      def identity_map(relation_name)
        @identity_map[relation_name]
      end

    end # Tracker

  end # Session
end # ROM
<commit_msg>Make Tracker#store private<commit_after>module ROM
  class Session

    # @api private
    class Tracker
      attr_reader :objects, :changelog
      private :objects, :changelog

      class ObjectNotTrackedError < StandardError
        def initialize(object)
          super("Tracker doesn't include #{object.inspect}")
        end
      end

      # @api private
      def initialize
        @identity_map = Hash.new { |hash, key| hash[key] = IdentityMap.build }
        @objects      = Hash.new
        @changelog    = []
      end

      # @api private
      def commit
        @changelog.each { |state| update(state.commit) }
        @changelog = []
        self
      end

      # @api private
      def fetch(object)
        @objects.fetch(object.object_id) { raise ObjectNotTrackedError, object }
      end

      # @api private
      def include?(object)
        @objects.key?(object.object_id)
      end

      # @api private
      def queue(state)
        @changelog << state
        update(state)
      end

      # @api private
      def update(state)
        store(state.object, state)
      end

      # @api private
      def store_transient(object)
        store(object, State::Transient.new(object))
        self
      end

      # @api private
      def store_persisted(object, mapper)
        store(object, State::Persisted.new(object, mapper))
        self
      end

      # @api private
      def identity_map(relation_name)
        @identity_map[relation_name]
      end

      private

      # @api private
      def store(object, state)
        @objects[object.object_id] = state
      end

    end # Tracker

  end # Session
end # ROM

{'fraction_non_alphanumeric': 0.08858447488584476, 'fraction_numerical': 0.0, 'mean_word_length': 1.9028268551236749, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3596052', 'n_tokens_mistral': 975, 'n_tokens_neox': 945, 'n_words': 236}