Class: GraphQL::Pundit::Instrumenters::Scope::ScopeResolver
- Inherits:
-
Object
- Object
- GraphQL::Pundit::Instrumenters::Scope::ScopeResolver
- Defined in:
- lib/graphql-pundit/instrumenters/scope.rb
Overview
Applies the scoping to the passed object
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#old_resolver ⇒ Object
readonly
Returns the value of attribute old_resolver.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(current_user, scope, old_resolver, field) ⇒ ScopeResolver
constructor
A new instance of ScopeResolver.
Constructor Details
#initialize(current_user, scope, old_resolver, field) ⇒ ScopeResolver
Returns a new instance of ScopeResolver.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/graphql-pundit/instrumenters/scope.rb', line 14 def initialize(current_user, scope, old_resolver, field) @current_user = current_user @old_resolver = old_resolver @field = field unless valid_value?(scope) raise ArgumentError, 'Invalid value passed to `scope`' end @scope = scope end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
12 13 14 |
# File 'lib/graphql-pundit/instrumenters/scope.rb', line 12 def current_user @current_user end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
12 13 14 |
# File 'lib/graphql-pundit/instrumenters/scope.rb', line 12 def field @field end |
#old_resolver ⇒ Object (readonly)
Returns the value of attribute old_resolver.
12 13 14 |
# File 'lib/graphql-pundit/instrumenters/scope.rb', line 12 def old_resolver @old_resolver end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
12 13 14 |
# File 'lib/graphql-pundit/instrumenters/scope.rb', line 12 def scope @scope end |