Class: CanTango::Configuration::RoleRegistry

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

Direct Known Subclasses

RoleGroups, Roles

Instance Attribute Summary collapse

Attributes inherited from Registry

#default, #registered

Instance Method Summary collapse

Methods inherited from Registry

#[], #clean!, #default!, #register, #registered?, #types, #types=

Instance Attribute Details

#has_methodObject (readonly)

Returns the value of attribute has_method.



4
5
6
# File 'lib/cantango/configuration/role_registry.rb', line 4

def has_method
  @has_method
end

#list_methodObject (readonly)

Returns the value of attribute list_method.



4
5
6
# File 'lib/cantango/configuration/role_registry.rb', line 4

def list_method
  @list_method
end

Instance Method Details

#clear!Object



39
40
41
42
43
# File 'lib/cantango/configuration/role_registry.rb', line 39

def clear!
  super
  @excluded = []
  @onlies = []
end

#exclude(*names) ⇒ Object



31
32
33
# File 'lib/cantango/configuration/role_registry.rb', line 31

def exclude *names
  @excluded = names.select_labels
end

#excludedObject



27
28
29
# File 'lib/cantango/configuration/role_registry.rb', line 27

def excluded
  @excluded ||= []
end

#filter?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/cantango/configuration/role_registry.rb', line 35

def filter?
  !(excluded + onlies).empty?
end

#onliesObject



23
24
25
# File 'lib/cantango/configuration/role_registry.rb', line 23

def onlies
  @onlies ||= []
end

#only(*names) ⇒ Object



19
20
21
# File 'lib/cantango/configuration/role_registry.rb', line 19

def only *names
  @onlies = names.select_labels
end