Sha256: bdf832663b53f4809be5e04d39930aa51cc5892bb8d6845d52947a450cf86295

Contents?: true

Size: 324 Bytes

Versions: 8

Compression:

Stored size: 324 Bytes

Contents

module AgnosticBackend
  module Indexable

    class CircularReferenceError < StandardError; end

    class ObjectObserver
      def initialize
        @objects = Set.new
      end

      def add(obj)
        raise CircularReferenceError.new(obj) if @objects.include? obj
        @objects << obj
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
agnostic_backend-1.0.4 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-1.0.3 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-1.0.2 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-1.0.1 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-1.0.0 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-0.9.9 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-0.9.8 lib/agnostic_backend/indexable/object_observer.rb
agnostic_backend-0.9.4 lib/agnostic_backend/indexable/object_observer.rb