Module: Padrino::CanCan::Helpers::ClassMethods

Defined in:
lib/padrino-cancan/helpers.rb

Instance Method Summary collapse

Instance Method Details

#registered_abilitiesObject



25
26
27
# File 'lib/padrino-cancan/helpers.rb', line 25

def registered_abilities
  @@_registered_abilities ||= {}
end

#role(roles, &block) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/padrino-cancan/helpers.rb', line 29

def role roles, &block
  if roles.is_a? Array
    roles.each do |role| allow_role role, &block end
  else
    allow_role roles, &block 
  end
end