Class: Noraneko::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/noraneko/registry.rb

Instance Method Summary collapse

Constructor Details

#initializeRegistry

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_aObject



21
22
23
# File 'lib/noraneko/registry.rb', line 21

def to_a
  @namespace.values
end