Module: GraphQL::Schema::Member::AcceptsDefinition::InitializeExtension Private

Defined in:
lib/graphql/schema/member/accepts_definition.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#accepts_definition_methodsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



152
153
154
# File 'lib/graphql/schema/member/accepts_definition.rb', line 152

def accepts_definition_methods
  self.class.accepts_definition_methods
end

#initialize(*args, **kwargs, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/graphql/schema/member/accepts_definition.rb', line 139

def initialize(*args, **kwargs, &block)
  self.class.accepts_definition_methods.each do |method_name|
    if kwargs.key?(method_name)
      value = kwargs.delete(method_name)
      if !value.is_a?(Array)
        value = [value]
      end
      instance_variable_set("@#{method_name}_args", value)
    end
  end
  super(*args, **kwargs, &block)
end