Class: Perm::Authorizer

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/perm/authorizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Authorizer

Returns a new instance of Authorizer.



7
8
9
# File 'lib/perm/authorizer.rb', line 7

def initialize(user)
  super @user = user
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



11
12
13
14
# File 'lib/perm/authorizer.rb', line 11

def method_missing(name, *args)
  return false if can_method?(name)
  super
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/perm/authorizer.rb', line 5

def user
  @user
end

Instance Method Details

#respond_to?(name) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/perm/authorizer.rb', line 16

def respond_to?(name)
  return true if can_method?(name)
  super
end