Module: AccessControl::Language

Defined in:
lib/access_control/language.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_id, *attrs) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/access_control/language.rb', line 4

def method_missing(method_id, *attrs)	     
  if /can_not_(.+)\?/.match(method_id.to_s)
    return !has_permission?($~[1])
  elsif /can_(.+)\?/.match(method_id.to_s)
    return has_permission?($~[1])                  
  else
    super		      
  end
end