Class: CanTango::Filter::RoleGroup
- Inherits:
-
Base
- Object
- Base
- CanTango::Filter::RoleGroup
- Defined in:
- lib/cantango/roles_ext/filter/role_group.rb
Instance Method Summary collapse
- #excluded? ⇒ Boolean
- #excluded_role_groups ⇒ Object
-
#initialize(role_group, role_groups = nil) ⇒ RoleGroup
constructor
A new instance of RoleGroup.
- #not_only? ⇒ Boolean
- #only_role_groups ⇒ Object
Constructor Details
#initialize(role_group, role_groups = nil) ⇒ RoleGroup
Returns a new instance of RoleGroup.
6 7 8 |
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 6 def initialize role_group, role_groups = nil super end |
Instance Method Details
#excluded? ⇒ Boolean
14 15 16 |
# File 'lib/cantango/roles_ext/filter/role_group.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/roles_ext/filter/role_group.rb', line 22 def excluded_role_groups CanTango.config.role_groups.excluded end |
#not_only? ⇒ Boolean
10 11 12 |
# File 'lib/cantango/roles_ext/filter/role_group.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/roles_ext/filter/role_group.rb', line 18 def only_role_groups CanTango.config.role_groups.onlies end |