Class: ApplicationPolicy::Scope
- Inherits:
-
Object
- Object
- ApplicationPolicy::Scope
- Defined in:
- lib/generators/verikloak/pundit/install/templates/application_policy.rb
Overview
Default scope for application policies.
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
Resolved scope.
Constructor Details
#initialize(user, scope) ⇒ Scope
Returns a new instance of Scope.
39 40 41 42 |
# File 'lib/generators/verikloak/pundit/install/templates/application_policy.rb', line 39 def initialize(user, scope) @user = user @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
35 36 37 |
# File 'lib/generators/verikloak/pundit/install/templates/application_policy.rb', line 35 def scope @scope end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
35 36 37 |
# File 'lib/generators/verikloak/pundit/install/templates/application_policy.rb', line 35 def user @user end |
Instance Method Details
#resolve ⇒ Object
Returns resolved scope.
45 46 47 |
# File 'lib/generators/verikloak/pundit/install/templates/application_policy.rb', line 45 def resolve scope.all end |