Sha256: 215e7a76612963a961bc47743f05747136a20a9418a12219f79a7e9ecee11f50

Contents?: true

Size: 433 Bytes

Versions: 16

Compression:

Stored size: 433 Bytes

Contents

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

16 entries across 16 versions & 1 rubygems

Version Path
punchblock-0.9.2 lib/punchblock/client/component_registry.rb
punchblock-0.9.1 lib/punchblock/client/component_registry.rb
punchblock-0.9.0 lib/punchblock/client/component_registry.rb
punchblock-0.8.4 lib/punchblock/client/component_registry.rb
punchblock-0.8.3 lib/punchblock/client/component_registry.rb
punchblock-0.8.2 lib/punchblock/client/component_registry.rb
punchblock-0.8.1 lib/punchblock/client/component_registry.rb
punchblock-0.8.0 lib/punchblock/client/component_registry.rb
punchblock-0.7.2 lib/punchblock/client/component_registry.rb
punchblock-0.7.1 lib/punchblock/client/component_registry.rb
punchblock-0.7.0 lib/punchblock/client/component_registry.rb
punchblock-0.6.2 lib/punchblock/client/component_registry.rb
punchblock-0.6.1 lib/punchblock/client/component_registry.rb
punchblock-0.6.0 lib/punchblock/client/component_registry.rb
punchblock-0.5.1 lib/punchblock/client/component_registry.rb
punchblock-0.5.0 lib/punchblock/client/component_registry.rb