Class: CanTango::PermissionEngine::Selector::RoleGroups

Inherits:
Base
  • Object
show all
Defined in:
lib/cantango/permission_engine/selector/role_groups.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#subject

Instance Method Summary collapse

Methods inherited from Base

#select

Constructor Details

#initialize(collector) ⇒ RoleGroups

Returns a new instance of RoleGroups.



7
8
9
# File 'lib/cantango/permission_engine/selector/role_groups.rb', line 7

def initialize collector
  @role_groups = collector.role_groups_list
end

Instance Attribute Details

#role_groupsObject (readonly)

Returns the value of attribute role_groups.



5
6
7
# File 'lib/cantango/permission_engine/selector/role_groups.rb', line 5

def role_groups
  @role_groups
end

Instance Method Details

#filter(role_group) ⇒ Object



15
16
17
# File 'lib/cantango/permission_engine/selector/role_groups.rb', line 15

def filter role_group
  CanTango::Filters::RoleGroupFilter.new role_group, role_groups
end

#relevant?(role_group) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/cantango/permission_engine/selector/role_groups.rb', line 11

def relevant? role_group
  filter(role_group).valid?
end