Sha256: c4d773d4d506503b934c7fc9c2020bffa78585ccf2f5446ad600f757b096e532

Contents?: true

Size: 454 Bytes

Versions: 13

Compression:

Stored size: 454 Bytes

Contents

module God
  def self.registry
    @registry ||= Registry.new
  end

  class Registry
    def initialize
      @storage = {}
    end

    def add(item)
      # raise TypeError unless item.is_a? God::Process
      @storage[item.name] = item
    end

    def remove(item)
      @storage.delete(item.name)
    end

    def size
      @storage.size
    end

    def [](name)
      @storage[name]
    end

    def reset
      @storage.clear
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
resurrected_god-1.0.0 lib/god/registry.rb
resurrected_god-0.14.0 lib/god/registry.rb
mcproc-2016.2.20 lib/god/registry.rb
god-0.13.7 lib/god/registry.rb
god-0.13.6 lib/god/registry.rb
god-0.13.5 lib/god/registry.rb
god-0.13.4 lib/god/registry.rb
god-0.13.3 lib/god/registry.rb
god-0.13.2 lib/god/registry.rb
god-0.13.1 lib/god/registry.rb
god-0.13.0 lib/god/registry.rb
god-0.12.1 lib/god/registry.rb
god-0.12.0 lib/god/registry.rb