Class: FixtureFox::Token
- Inherits:
-
Object
- Object
- FixtureFox::Token
- Defined in:
- lib/fixture_fox/token.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#initial_indent ⇒ Object
readonly
Returns the value of attribute initial_indent.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#litt ⇒ Object
readonly
Returns the value of attribute litt.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(s) ⇒ Object
- #error(msg) ⇒ Object
-
#initialize(file, lineno, initial_indent, pos, litt) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(file, lineno, initial_indent, pos, litt) ⇒ Token
Returns a new instance of Token.
10 11 12 13 |
# File 'lib/fixture_fox/token.rb', line 10 def initialize(file, lineno, initial_indent, pos, litt) @file, @lineno, @initial_indent, @pos, @litt = file, lineno, initial_indent, pos, litt @value = @litt end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
3 4 5 |
# File 'lib/fixture_fox/token.rb', line 3 def file @file end |
#initial_indent ⇒ Object (readonly)
Returns the value of attribute initial_indent.
5 6 7 |
# File 'lib/fixture_fox/token.rb', line 5 def initial_indent @initial_indent end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
4 5 6 |
# File 'lib/fixture_fox/token.rb', line 4 def lineno @lineno end |
#litt ⇒ Object (readonly)
Returns the value of attribute litt.
7 8 9 |
# File 'lib/fixture_fox/token.rb', line 7 def litt @litt end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
6 7 8 |
# File 'lib/fixture_fox/token.rb', line 6 def pos @pos end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/fixture_fox/token.rb', line 8 def value @value end |
Instance Method Details
#==(s) ⇒ Object
15 |
# File 'lib/fixture_fox/token.rb', line 15 def ==(s) @litt == s end |
#error(msg) ⇒ Object
18 19 20 |
# File 'lib/fixture_fox/token.rb', line 18 def error(msg) raise ParseError.new(file, lineno, initial_indent + pos, msg) end |
#to_s ⇒ Object
16 |
# File 'lib/fixture_fox/token.rb', line 16 def to_s() @litt end |