Class: LibraryPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
app/policies/library_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



32
33
34
35
# File 'app/policies/library_policy.rb', line 32

def initialize(user, scope)
  @user = user
  @scope = scope
end

Instance Attribute Details

#scope ⇒ Object (readonly)

Returns the value of attribute scope.



30
31
32
# File 'app/policies/library_policy.rb', line 30

def scope
  @scope
end

#user ⇒ Object (readonly)

Returns the value of attribute user.



30
31
32
# File 'app/policies/library_policy.rb', line 30

def user
  @user
end

Instance Method Details

#resolve ⇒ Object



37
38
39
# File 'app/policies/library_policy.rb', line 37

def resolve
  scope.all
end