Class: Scanner::Token
- Inherits:
-
Object
- Object
- Scanner::Token
- Defined in:
- lib/scanner/token.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(symbol, content, line, column) ⇒ Token
constructor
A new instance of Token.
- #is?(symbol) ⇒ Boolean
- #is_not?(symbol) ⇒ Boolean
Constructor Details
#initialize(symbol, content, line, column) ⇒ Token
Returns a new instance of Token.
5 6 7 8 9 10 |
# File 'lib/scanner/token.rb', line 5 def initialize(symbol, content, line, column) @symbol = symbol @content = content @line = line @column = column end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
3 4 5 |
# File 'lib/scanner/token.rb', line 3 def column @column end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/scanner/token.rb', line 3 def content @content end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/scanner/token.rb', line 3 def line @line end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
3 4 5 |
# File 'lib/scanner/token.rb', line 3 def symbol @symbol end |
Instance Method Details
#is?(symbol) ⇒ Boolean
12 13 14 |
# File 'lib/scanner/token.rb', line 12 def is?(symbol) @symbol == symbol end |
#is_not?(symbol) ⇒ Boolean
16 17 18 |
# File 'lib/scanner/token.rb', line 16 def is_not?(symbol) not is? symbol end |