Class: ApplicationPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/pineapples/templates/app/policies!=pundit!/application_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



39
40
41
42
# File 'lib/pineapples/templates/app/policies!=pundit!/application_policy.rb', line 39

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

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



37
38
39
# File 'lib/pineapples/templates/app/policies!=pundit!/application_policy.rb', line 37

def scope
  @scope
end

#userObject (readonly)

Returns the value of attribute user.



37
38
39
# File 'lib/pineapples/templates/app/policies!=pundit!/application_policy.rb', line 37

def user
  @user
end

Instance Method Details

#resolveObject



44
45
46
# File 'lib/pineapples/templates/app/policies!=pundit!/application_policy.rb', line 44

def resolve
  scope
end