Exception: Apricot::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/apricot/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, line, msg, incomplete = false) ⇒ SyntaxError

Returns a new instance of SyntaxError.



5
6
7
8
9
10
# File 'lib/apricot/errors.rb', line 5

def initialize(filename, line, msg, incomplete = false)
  @filename = filename
  @line = line
  @msg = msg
  @incomplete = incomplete
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



3
4
5
# File 'lib/apricot/errors.rb', line 3

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/apricot/errors.rb', line 3

def line
  @line
end

#msgObject (readonly)

Returns the value of attribute msg.



3
4
5
# File 'lib/apricot/errors.rb', line 3

def msg
  @msg
end

Instance Method Details

#incomplete?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/apricot/errors.rb', line 12

def incomplete?
  @incomplete
end

#to_sObject



16
17
18
# File 'lib/apricot/errors.rb', line 16

def to_s
  "#{@filename}:#{@line}: #{@msg}"
end