Class: GraphqlDevise::MountMethod::OperationPreparers::ResourceKlassSetter

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_devise/mount_method/operation_preparers/resource_klass_setter.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ ResourceKlassSetter

Returns a new instance of ResourceKlassSetter.



7
8
9
# File 'lib/graphql_devise/mount_method/operation_preparers/resource_klass_setter.rb', line 7

def initialize(klass)
  @klass = klass
end

Instance Method Details

#call(operation) ⇒ Object



11
12
13
14
15
# File 'lib/graphql_devise/mount_method/operation_preparers/resource_klass_setter.rb', line 11

def call(operation, **)
  operation.instance_variable_set(:@resource_klass, @klass)

  operation
end