Class: ChangePolicy::Scope

Inherits:
ApplicationPolicy
  • Object
show all
Defined in:
app/policies/change_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



4
5
6
7
# File 'app/policies/change_policy.rb', line 4

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

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



3
4
5
# File 'app/policies/change_policy.rb', line 3

def scope
  @scope
end

#userObject (readonly)

Returns the value of attribute user.



3
4
5
# File 'app/policies/change_policy.rb', line 3

def user
  @user
end

Instance Method Details

#resolveObject



8
9
10
# File 'app/policies/change_policy.rb', line 8

def resolve
  scope.all
end