lib/nylas/registry.rb in nylas-4.2.1 vs lib/nylas/registry.rb in nylas-4.2.2

- old
+ new

@@ -3,17 +3,19 @@ # retrieve does not exist. class Registry # Used to indicate an attempt to retrieve something not yet registered in a registry # Includes the list of keys in the registry for debug purposes. class MissingKeyError < Error + attr_accessor :key def initialize(key, keys) super("key #{key} not in #{keys}") + self.key = key end end attr_accessor :registry_data extend Forwardable - def_delegators :registry_data, :keys, :each, :reduce + def_delegators :registry_data, :keys, :each, :reduce, :key? def initialize(initial_data = {}) self.registry_data = initial_data.each.each_with_object({}) do |(key, value), registry| registry[key] = value end