Class: Calib::Pundit::ControllerNestable::Scope
- Inherits:
-
Object
- Object
- Calib::Pundit::ControllerNestable::Scope
- Defined in:
- lib/calib/pundit/controller_nestable.rb
Overview
:nodoc:
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.
25 26 27 28 |
# File 'lib/calib/pundit/controller_nestable.rb', line 25 def initialize(user, scope) @user = user @scope = scope.is_a?(Array) ? scope.last : scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
23 24 25 |
# File 'lib/calib/pundit/controller_nestable.rb', line 23 def scope @scope end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
23 24 25 |
# File 'lib/calib/pundit/controller_nestable.rb', line 23 def user @user end |
Instance Method Details
#resolve ⇒ Object
30 31 32 |
# File 'lib/calib/pundit/controller_nestable.rb', line 30 def resolve scope end |