Sha256: bee7d79a3410254b6ed7e8010d60d038a398f30133e10873b743e6a7f00212ad

Contents?: true

Size: 583 Bytes

Versions: 20

Compression:

Stored size: 583 Bytes

Contents

# encoding: utf-8

module Punchblock
  class Client
    class ComponentRegistry
      def initialize
        @mutex = Mutex.new
        @components = Hash.new
      end

      def <<(component)
        @mutex.synchronize do
          @components[component.source_uri] = component
        end
      end

      def find_by_uri(uri)
        @mutex.synchronize do
          @components[uri]
        end
      end

      def delete(component)
        @mutex.synchronize do
          uri = @components.key component
          @components.delete uri
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
punchblock-2.7.5 lib/punchblock/client/component_registry.rb
punchblock-2.7.3 lib/punchblock/client/component_registry.rb
punchblock-2.7.2 lib/punchblock/client/component_registry.rb
punchblock-2.7.1 lib/punchblock/client/component_registry.rb
punchblock-2.7.0 lib/punchblock/client/component_registry.rb
punchblock-2.6.0 lib/punchblock/client/component_registry.rb
punchblock-2.5.3 lib/punchblock/client/component_registry.rb
punchblock-2.5.2 lib/punchblock/client/component_registry.rb
punchblock-2.5.1 lib/punchblock/client/component_registry.rb
punchblock-2.5.0 lib/punchblock/client/component_registry.rb
punchblock-2.4.2 lib/punchblock/client/component_registry.rb
punchblock-2.4.0 lib/punchblock/client/component_registry.rb
punchblock-2.3.1 lib/punchblock/client/component_registry.rb
punchblock-2.3.0 lib/punchblock/client/component_registry.rb
punchblock-2.2.2 lib/punchblock/client/component_registry.rb
punchblock-2.2.1 lib/punchblock/client/component_registry.rb
punchblock-2.2.0 lib/punchblock/client/component_registry.rb
punchblock-2.1.1 lib/punchblock/client/component_registry.rb
punchblock-2.1.0 lib/punchblock/client/component_registry.rb
punchblock-2.0.2 lib/punchblock/client/component_registry.rb