Registry

Register stuff to stuff with stuff and stuff.

For a use case, see sharespost/authorize.

Usage

Call Registry on your object:

“lass ClassWithRegistry Registry(self) end

Your class now has a registry:

ClassWithRegistry.registry

Register something:

“lassWithRegistry.register(:some_key, ‘value to register’) { ‘proc to register’ }

ClassWithRegistry.registry[:some_key]

You can give any object a registry:

“tring_with_registry = ‘a’ Registry(string_with_registry) string_with_registry.register(:a, ‘b’)

string_with_registry[:a]