Sha256: bf7c1d342be91f46e046d6b65e0a2061b5eecb0b6c9242a6762a2787c4ef38b7

Contents?: true

Size: 354 Bytes

Versions: 4

Compression:

Stored size: 354 Bytes

Contents

require "active_support/hash_with_indifferent_access"

module Guise
  class Registry
    def initialize
      @registry = HashWithIndifferentAccess.new
    end

    def [](name)
      @registry.fetch(name) do
        raise DefinitionNotFound.new(name)
      end
    end

    def []=(name, definition)
      @registry[name] = definition
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
guise-0.9.0 lib/guise/registry.rb
guise-0.8.0 lib/guise/registry.rb
guise-0.7.0 lib/guise/registry.rb
guise-0.6.1 lib/guise/registry.rb