Sha256: e2a45a298d2aaa30d50ec404b22d86f19f6ab4aee4984a84445b7ae9e28592ff

Contents?: true

Size: 452 Bytes

Versions: 15

Compression:

Stored size: 452 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.component_id] = component
        end
      end

      def find_by_id(component_id)
        @mutex.synchronize do
          @components[component_id]
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
punchblock-1.6.1 lib/punchblock/client/component_registry.rb
punchblock-1.6.0 lib/punchblock/client/component_registry.rb
punchblock-1.5.3 lib/punchblock/client/component_registry.rb
punchblock-1.5.2 lib/punchblock/client/component_registry.rb
punchblock-1.5.1 lib/punchblock/client/component_registry.rb
punchblock-1.5.0 lib/punchblock/client/component_registry.rb
punchblock-1.4.1 lib/punchblock/client/component_registry.rb
punchblock-1.4.0 lib/punchblock/client/component_registry.rb
punchblock-1.3.0 lib/punchblock/client/component_registry.rb
punchblock-1.2.0 lib/punchblock/client/component_registry.rb
punchblock-1.1.0 lib/punchblock/client/component_registry.rb
punchblock-1.0.0 lib/punchblock/client/component_registry.rb
punchblock-0.12.0 lib/punchblock/client/component_registry.rb
punchblock-0.11.0 lib/punchblock/client/component_registry.rb
punchblock-0.10.0 lib/punchblock/client/component_registry.rb