Class: CanTango::Configuration::CandidateRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/configuration/candidate_registry.rb

Direct Known Subclasses

UserAccounts, Users

Defined Under Namespace

Classes: ClassRegistry, NameRegistry

Instance Method Summary collapse

Instance Method Details

#class_registryObject



34
35
36
# File 'lib/cantango/configuration/candidate_registry.rb', line 34

def class_registry
  ClassRegistry.instance
end

#name_registryObject



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

#registeredObject



14
15
16
# File 'lib/cantango/configuration/candidate_registry.rb', line 14

def registered
  name_registry.registered
end

#registered?(name) ⇒ Boolean

Returns:

  • (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

Returns:

  • (Boolean)


26
27
28
# File 'lib/cantango/configuration/candidate_registry.rb', line 26

def registered_class? name
  class_registry.registered? name
end

#registered_classesObject



18
19
20
# File 'lib/cantango/configuration/candidate_registry.rb', line 18

def registered_classes
  class_registry.registered
end