Class: Kan::AbilitiesList
- Inherits:
-
Object
- Object
- Kan::AbilitiesList
- Defined in:
- lib/kan/abilities_list.rb
Constant Summary collapse
- ROLES_DETECT =
'roles'.freeze
Instance Method Summary collapse
- #call(*payload) ⇒ Object
-
#initialize(name, list) ⇒ AbilitiesList
constructor
A new instance of AbilitiesList.
Constructor Details
#initialize(name, list) ⇒ AbilitiesList
Returns a new instance of AbilitiesList.
5 6 7 8 |
# File 'lib/kan/abilities_list.rb', line 5 def initialize(name, list) @name = name @list = list end |
Instance Method Details
#call(*payload) ⇒ Object
10 11 12 |
# File 'lib/kan/abilities_list.rb', line 10 def call(*payload) @name == ROLES_DETECT ? mapped_roles(payload) : ability_check(payload) end |