Module: GraphQL::Define::InstanceDefinable
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)
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.metadata.dup
end
|
12
13
14
|
# File 'lib/graphql/define/instance_definable.rb', line 12
def metadata
@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
|