Sha256: daa79a7923ced01632ac8c5bdff64b54d636b36b9492b011f36dafa000370dfb
Contents?: true
Size: 706 Bytes
Versions: 18
Compression:
Stored size: 706 Bytes
Contents
module Bullet module Registry class Base attr_reader :registry def initialize @registry = {} end def [](key) @registry[key] end def each(&block) @registry.each(&block) end def delete(base) @registry.delete(base) end def select(*args, &block) @registry.select(*args, &block) end def add(key, value) @registry[key] ||= Set.new if value.is_a? Array @registry[key] += value else @registry[key] << value end end def include?(key, value) @registry[key] && @registry[key].include?(value) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems