Class: AbstractResourcePolicy::Scope
- Inherits:
-
Object
- Object
- AbstractResourcePolicy::Scope
- Defined in:
- app/policies/abstract_resource_policy.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(user, scope) ⇒ Scope
constructor
A new instance of Scope.
- #resolve ⇒ Object
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_user ⇒ Object (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 |
#scope ⇒ Object (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
#resolve ⇒ Object
11 12 13 |
# File 'app/policies/abstract_resource_policy.rb', line 11 def resolve scope.all end |