Class: Registry::Registry
- Inherits:
-
Object
- Object
- Registry::Registry
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/registry.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, object) ⇒ Object
- #clear ⇒ Object
- #delete(key) ⇒ Object
- #objects ⇒ Object
Instance Method Details
#[](key) ⇒ Object
47 48 49 |
# File 'lib/registry.rb', line 47 def [](key) key && objects[key.to_sym] || raise(UnknownKey, MSGS[:unknown] % [key, objects.keys.sort]) end |
#[]=(key, object) ⇒ Object
43 44 45 |
# File 'lib/registry.rb', line 43 def []=(key, object) objects[key.to_sym] = object end |
#clear ⇒ Object
59 60 61 |
# File 'lib/registry.rb', line 59 def clear objects.clear end |
#delete(key) ⇒ Object
51 52 53 |
# File 'lib/registry.rb', line 51 def delete(key) objects.delete(key) end |
#objects ⇒ Object
55 56 57 |
# File 'lib/registry.rb', line 55 def objects @objects ||= {} end |