Exception: Mirah::MirahError

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

Direct Known Subclasses

NodeError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, position = nil, diagnostic = nil) ⇒ MirahError



22
23
24
25
26
# File 'lib/mirah/errors.rb', line 22

def initialize(message, position=nil, diagnostic=nil)
  super(message)
  @position = position
  @diagnostic = diagnostic
end

Instance Attribute Details

#causeObject

Returns the value of attribute cause.



20
21
22
# File 'lib/mirah/errors.rb', line 20

def cause
  @cause
end

#diagnosticObject

Returns the value of attribute diagnostic.



19
20
21
# File 'lib/mirah/errors.rb', line 19

def diagnostic
  @diagnostic
end

#positionObject

Returns the value of attribute position.



18
19
20
# File 'lib/mirah/errors.rb', line 18

def position
  @position
end

Instance Method Details

#inspectObject



28
29
30
# File 'lib/mirah/errors.rb', line 28

def inspect
  "MirahError: #{message} #{position}"
end