Class: GraphQL::Language::Token
- Inherits:
-
Object
- Object
- GraphQL::Language::Token
- Defined in:
- lib/graphql/language/token.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(value:, name:, line:, col:) ⇒ Token
constructor
A new instance of Token.
- #line_and_column ⇒ Object
- #to_f ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (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_column ⇒ Object
16 17 18 |
# File 'lib/graphql/language/token.rb', line 16 def line_and_column [@line, @col] end |
#to_f ⇒ Object
14 |
# File 'lib/graphql/language/token.rb', line 14 def to_f; @value.to_f; end |
#to_i ⇒ Object
13 |
# File 'lib/graphql/language/token.rb', line 13 def to_i; @value.to_i; end |
#to_s ⇒ Object
12 |
# File 'lib/graphql/language/token.rb', line 12 def to_s; @value; end |