class YARD::Parser::Ruby::Legacy::RubyToken::Token
Represents a token in the Ruby
lexer
Constants
- NO_TEXT
-
@private
Attributes
@return [Integer] the character number in the file/stream the token
is located.
@return [Symbol] the lexical state at the token
@return [Integer] the line number in the file/stream the token is
located.
@return [String] the token text value
Public Class Methods
Source
# File lib/yard/parser/ruby/legacy/ruby_lex.rb, line 37 def initialize(line_no, char_no) @line_no = line_no @char_no = char_no @text = NO_TEXT end
Creates a new Token
object @param [Integer] line_no
the line number to initialize the token to @param [Integer] char_no
the char number to initialize the token to
Public Instance Methods
Source
# File lib/yard/parser/ruby/legacy/ruby_lex.rb, line 47 def set_text(text) @text = text self end
Chainable way to sets the text attribute
@param [String] text the new text @return [Token] this token object