123456789_123456789_123456789_123456789_123456789_

Class: RBS::Parser::Token

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/parser/token.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(type:, location:) ⇒ Token

[ GitHub ]

  
# File 'lib/rbs/parser/token.rb', line 9

def initialize(type:, location:)
  @type = type
  @location = location
end

Instance Attribute Details

#comment?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rbs/parser/token.rb', line 18

def comment?
  @type == :tCOMMENT || @type == :tLINECOMMENT
end

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/parser/token.rb', line 7

attr_reader :location

#type (readonly)

[ GitHub ]

  
# File 'lib/rbs/parser/token.rb', line 6

attr_reader :type

Instance Method Details

#value

[ GitHub ]

  
# File 'lib/rbs/parser/token.rb', line 14

def value
  @location.source
end