Class: CanTango::Configuration::CandidateRegistry
- Inherits:
-
Object
- Object
- CanTango::Configuration::CandidateRegistry
show all
- Defined in:
- lib/cantango/configuration/candidate_registry.rb
Defined Under Namespace
Classes: ClassRegistry, NameRegistry
Instance Method Summary
collapse
Instance Method Details
#class_registry ⇒ Object
34
35
36
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 34
def class_registry
ClassRegistry.instance
end
|
#name_registry ⇒ Object
30
31
32
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 30
def name_registry
NameRegistry.instance
end
|
#register(name, clazz) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 7
def register name, clazz
raise "first arg must be a label" if !name.kind_of_label?
raise "second arg must be a Class" if !clazz.kind_of? Class
name_registry.register name.to_sym
class_registry.register clazz
end
|
#registered ⇒ Object
14
15
16
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 14
def registered
name_registry.registered
end
|
#registered?(name) ⇒ Boolean
22
23
24
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 22
def registered? name
name_registry.registered? name
end
|
#registered_class?(name) ⇒ Boolean
26
27
28
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 26
def registered_class? name
class_registry.registered? name
end
|
#registered_classes ⇒ Object
18
19
20
|
# File 'lib/cantango/configuration/candidate_registry.rb', line 18
def registered_classes
class_registry.registered
end
|