Class: Padrino::CanCan::Ability
- Inherits:
-
Object
- Object
- Padrino::CanCan::Ability
- Includes:
- CanCan::Ability
- Defined in:
- lib/padrino-cancan/helpers.rb
Instance Method Summary collapse
-
#initialize(account, registered_abilities) ⇒ Ability
constructor
A new instance of Ability.
Constructor Details
#initialize(account, registered_abilities) ⇒ Ability
Returns a new instance of Ability.
52 53 54 55 56 57 58 |
# File 'lib/padrino-cancan/helpers.rb', line 52 def initialize account, registered_abilities role = account.role.to_sym rescue :any (registered_abilities[role] || []).each do |cans| instance_eval &cans end end |