Class: SrcLexer::Token
- Inherits:
-
Object
- Object
- SrcLexer::Token
- Defined in:
- lib/src_lexer.rb
Instance Attribute Summary collapse
-
#char_no ⇒ Object
readonly
Returns the value of attribute char_no.
-
#line_no ⇒ Object
readonly
Returns the value of attribute line_no.
-
#str ⇒ Object
readonly
Returns the value of attribute str.
Instance Method Summary collapse
- #==(other_object) ⇒ Object
-
#initialize(str, line_no, char_no) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(str, line_no, char_no) ⇒ Token
Returns a new instance of Token.
8 9 10 11 12 |
# File 'lib/src_lexer.rb', line 8 def initialize(str, line_no, char_no) @str = str @line_no = line_no @char_no = char_no end |
Instance Attribute Details
#char_no ⇒ Object (readonly)
Returns the value of attribute char_no.
6 7 8 |
# File 'lib/src_lexer.rb', line 6 def char_no @char_no end |
#line_no ⇒ Object (readonly)
Returns the value of attribute line_no.
6 7 8 |
# File 'lib/src_lexer.rb', line 6 def line_no @line_no end |
#str ⇒ Object (readonly)
Returns the value of attribute str.
6 7 8 |
# File 'lib/src_lexer.rb', line 6 def str @str end |
Instance Method Details
#==(other_object) ⇒ Object
14 15 16 |
# File 'lib/src_lexer.rb', line 14 def ==(other_object) @str == other_object.str && @line_no == other_object.line_no && @char_no == other_object.char_no end |