Class: CanTango::Filters::RoleGroupFilter
- Inherits:
-
Filter
- Object
- Filter
- CanTango::Filters::RoleGroupFilter
show all
- Defined in:
- lib/cantango/filters/role_group_filter.rb
Instance Attribute Summary
Attributes inherited from Filter
#include_list, #item
Instance Method Summary
collapse
Methods inherited from Filter
#in_include_list?, #valid?
Constructor Details
#initialize(role_group, role_groups = nil) ⇒ RoleGroupFilter
Returns a new instance of RoleGroupFilter.
6
7
8
|
# File 'lib/cantango/filters/role_group_filter.rb', line 6
def initialize role_group, role_groups = nil
super
end
|
Instance Method Details
#excluded? ⇒ Boolean
14
15
16
|
# File 'lib/cantango/filters/role_group_filter.rb', line 14
def excluded?
!excluded_role_groups.empty? && excluded_role_groups.include?(role_group)
end
|
#excluded_role_groups ⇒ Object
22
23
24
|
# File 'lib/cantango/filters/role_group_filter.rb', line 22
def excluded_role_groups
CanTango.config.role_groups.excluded
end
|
#not_only? ⇒ Boolean
10
11
12
|
# File 'lib/cantango/filters/role_group_filter.rb', line 10
def not_only?
!only_role_groups.empty? && !only_role_groups.include?(role_group)
end
|
#only_role_groups ⇒ Object
18
19
20
|
# File 'lib/cantango/filters/role_group_filter.rb', line 18
def only_role_groups
CanTango.config.role_groups.onlies
end
|