Class: ApplicationPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/pundit/install/templates/application_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.


42
43
44
45
# File 'lib/generators/pundit/install/templates/application_policy.rb', line 42

def initialize(user, scope)
  @user = user
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope


40
41
42
# File 'lib/generators/pundit/install/templates/application_policy.rb', line 40

def scope
  @scope
end

#userObject (readonly)

Returns the value of attribute user


40
41
42
# File 'lib/generators/pundit/install/templates/application_policy.rb', line 40

def user
  @user
end

Instance Method Details

#resolveObject


47
48
49
# File 'lib/generators/pundit/install/templates/application_policy.rb', line 47

def resolve
  scope.all
end