Class: ApplicationPolicy::Scope
- Inherits:
-
Object
- Object
- ApplicationPolicy::Scope
- Defined in:
- lib/kowl/templates/app/policies/application_policy.rb
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
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.
29 30 31 32 |
# File 'lib/kowl/templates/app/policies/application_policy.rb', line 29 def initialize(user, scope) @user = user @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
27 28 29 |
# File 'lib/kowl/templates/app/policies/application_policy.rb', line 27 def scope @scope end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
27 28 29 |
# File 'lib/kowl/templates/app/policies/application_policy.rb', line 27 def user @user end |
Instance Method Details
#resolve ⇒ Object
34 35 36 |
# File 'lib/kowl/templates/app/policies/application_policy.rb', line 34 def resolve scope.all end |