Class: Noraneko::Registry
- Inherits:
-
Object
- Object
- Noraneko::Registry
- Defined in:
- lib/noraneko/registry.rb
Instance Method Summary collapse
- #delete(nconst) ⇒ Object
- #find(name) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #put(nconst) ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
5 6 7 |
# File 'lib/noraneko/registry.rb', line 5 def initialize @namespace = {} end |
Instance Method Details
#delete(nconst) ⇒ Object
17 18 19 |
# File 'lib/noraneko/registry.rb', line 17 def delete(nconst) @namespace.delete(nconst.qualified_name) end |
#find(name) ⇒ Object
9 10 11 |
# File 'lib/noraneko/registry.rb', line 9 def find(name) @namespace[name] end |
#put(nconst) ⇒ Object
13 14 15 |
# File 'lib/noraneko/registry.rb', line 13 def put(nconst) @namespace[nconst.qualified_name] = nconst end |
#to_a ⇒ Object
21 22 23 |
# File 'lib/noraneko/registry.rb', line 21 def to_a @namespace.values end |