Class: Calib::Pundit::ControllerNestable::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/calib/pundit/controller_nestable.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#scopeObject (readonly)

Returns the value of attribute scope.



23
24
25
# File 'lib/calib/pundit/controller_nestable.rb', line 23

def scope
  @scope
end

#userObject (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

#resolveObject



30
31
32
# File 'lib/calib/pundit/controller_nestable.rb', line 30

def resolve
  scope
end