Exception: KDL::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/kdl/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, filename = nil, line = nil, column = nil) ⇒ Error

Returns a new instance of Error.



7
8
9
10
11
12
13
14
# File 'lib/kdl/error.rb', line 7

def initialize(message, filename = nil, line = nil, column = nil)
  message += " (#{line}:#{column})" if line
  message = "#{[filename, line, column].compact.join(':')}: #{message}" if filename
  super(message)
  @filename = filename
  @line = line
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



5
6
7
# File 'lib/kdl/error.rb', line 5

def column
  @column
end

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/kdl/error.rb', line 5

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



5
6
7
# File 'lib/kdl/error.rb', line 5

def line
  @line
end