class GraphQL::Language::Nodes::EnumTypeDefinition
Attributes
directives
[R]
Array[Directive]
values
[R]
Array[EnumValueDefinition]
Public Class Methods
# File lib/graphql/language/nodes.rb, line 2217 def self.from_a(filename, line, col, name, description, directives, values, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, description: description, comment: comment, directives: directives, values: values) end
(?name: untyped, ?description: untyped, ?comment: untyped, ?directives: Array[Directive], ?values: Array[EnumValueDefinition], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) → void
Source
# File lib/graphql/language/nodes.rb, line 2203 def initialize(name: nil, description: nil, comment: nil, directives: NO_CHILDREN, values: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) @line = line @col = col @pos = pos @filename = filename @source = source @name = name @description = description && -description @comment = comment @directives = directives.freeze @values = values.freeze @definition_pos = definition_pos end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 2188 def children @children ||= begin if !@directives.empty? || !@values.empty? new_children = [] new_children.concat(@directives) new_children.concat(@values) new_children.freeze new_children else NO_CHILDREN end end end
Source
# File lib/graphql/language/nodes.rb, line 2221 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @description, @directives, @values, ] end
Source
# File lib/graphql/language/nodes.rb, line 2232 def marshal_load(values) @line, @col, @filename, @name, @description, @directives, @values = values end
# File lib/graphql/language/nodes.rb, line 2180 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 2184 def merge_value(**node_opts) merge(values: values + [GraphQL::Language::Nodes::EnumValueDefinition.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 2171 def scalars @scalars ||= [@name].freeze end
Source
# File lib/graphql/language/nodes.rb, line 2160 def visit_method :on_enum_type_definition end