class GraphQL::Language::Nodes::NameOnlyNode
Base class for nodes whose only value is a name (no child nodes or other scalars)
Attributes
Public Class Methods
# File lib/graphql/language/nodes.rb, line 295 def self.from_a(filename, line, col, name, comment: nil) self.new(filename: filename, line: line, col: col, name: name) end
(?name: untyped, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) → void
Source
# File lib/graphql/language/nodes.rb, line 286 def initialize(name: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) @line = line @col = col @pos = pos @filename = filename @source = source @name = name end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 299 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, ] end
Source
# File lib/graphql/language/nodes.rb, line 307 def marshal_load(values) @line, @col, @filename, @name = values end
Source
# File lib/graphql/language/nodes.rb, line 281 def scalars @scalars ||= [@name].freeze end
Source
# File lib/graphql/language/nodes.rb, line 274 def visit_method :on_name_only_node end