Class: AbstractResourcePolicy::Scope

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



6
7
8
9
# File 'app/policies/abstract_resource_policy.rb', line 6

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

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.



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

def current_user
  @current_user
end

#scopeObject (readonly)

Returns the value of attribute scope.



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

def scope
  @scope
end

Instance Method Details

#resolveObject



11
12
13
# File 'app/policies/abstract_resource_policy.rb', line 11

def resolve
  scope.all
end