class Lingo::TokenizeError

Attributes

err[R]
file[R]
line[R]
num[R]

Public Class Methods

new(line, file, num, err) click to toggle source
# File lib/lingo/error.rb, line 224
def initialize(line, file, num, err)
  @line, @file, @num, @err = line, file, num, err
end

Public Instance Methods

to_s() click to toggle source
# File lib/lingo/error.rb, line 228
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