Class: GraphQL::Language::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/language/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, name:, line:, col:) ⇒ Token

Returns a new instance of Token.



5
6
7
8
9
10
# File 'lib/graphql/language/token.rb', line 5

def initialize(value:, name:, line:, col:)
  @name = name
  @value = value
  @line = line
  @col = col
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/graphql/language/token.rb', line 4

def name
  @name
end

Instance Method Details

#line_and_columnObject



16
17
18
# File 'lib/graphql/language/token.rb', line 16

def line_and_column
  [@line, @col]
end

#to_fObject



14
# File 'lib/graphql/language/token.rb', line 14

def to_f; @value.to_f; end

#to_iObject



13
# File 'lib/graphql/language/token.rb', line 13

def to_i; @value.to_i; end

#to_sObject



12
# File 'lib/graphql/language/token.rb', line 12

def to_s; @value; end