Module: GraphQL::Define::InstanceDefinable

Included in:
Argument, BaseType, GraphQL::Directive, EnumType::EnumValue, Field, Relay::Mutation, Schema
Defined in:
lib/graphql/define/instance_definable.rb

Defined Under Namespace

Modules: ClassMethods Classes: AssignAttribute, AssignMetadataKey, Definition

Instance Method Summary collapse

Instance Method Details

#define(**kwargs, &block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/graphql/define/instance_definable.rb', line 17

def define(**kwargs, &block)
  # make sure the previous definition_proc was executed:
  ensure_defined
  stash_dependent_methods
  @pending_definition = Definition.new(kwargs, block)
  nil
end

#initialize_copy(other) ⇒ Object



33
34
35
36
# File 'lib/graphql/define/instance_definable.rb', line 33

def initialize_copy(other)
  super
  @metadata = other..dup
end

#metadataObject



12
13
14
# File 'lib/graphql/define/instance_definable.rb', line 12

def 
  @metadata ||= {}
end

#redefine(**kwargs, &block) ⇒ Object



26
27
28
29
30
31
# File 'lib/graphql/define/instance_definable.rb', line 26

def redefine(**kwargs, &block)
  ensure_defined
  new_inst = self.dup
  new_inst.define(**kwargs, &block)
  new_inst
end