Exception: Lingo::TokenizeError
- Inherits:
-
LingoError
- Object
- StandardError
- LingoError
- Lingo::TokenizeError
- Defined in:
- lib/lingo/error.rb
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#num ⇒ Object
readonly
Returns the value of attribute num.
Instance Method Summary collapse
-
#initialize(line, file, num, err) ⇒ TokenizeError
constructor
A new instance of TokenizeError.
- #to_s ⇒ Object
Methods inherited from LingoError
Constructor Details
#initialize(line, file, num, err) ⇒ TokenizeError
Returns a new instance of TokenizeError.
225 226 227 |
# File 'lib/lingo/error.rb', line 225 def initialize(line, file, num, err) @line, @file, @num, @err = line, file, num, err end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
223 224 225 |
# File 'lib/lingo/error.rb', line 223 def err @err end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
223 224 225 |
# File 'lib/lingo/error.rb', line 223 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
223 224 225 |
# File 'lib/lingo/error.rb', line 223 def line @line end |
#num ⇒ Object (readonly)
Returns the value of attribute num.
223 224 225 |
# File 'lib/lingo/error.rb', line 223 def num @num end |
Instance Method Details
#to_s ⇒ Object
229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/lingo/error.rb', line 229 def to_s line, file = self.line, self.file if line.is_a?(String) && line.length > 48 line = line[0, 45] + '...' end file &&= "#{file}:#{num}: " error("An error occured while trying to tokenize #{file}#{line.inspect}") end |