Exception: Yay::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



4
5
6
# File 'lib/yay/errors.rb', line 4

def position
  @position
end

Instance Method Details

#printable_messageObject



6
7
8
# File 'lib/yay/errors.rb', line 6

def printable_message
  raise "Unimplemented printable error"
end

#printable_positionObject



10
11
12
13
14
15
16
17
18
# File 'lib/yay/errors.rb', line 10

def printable_position
  array  = @position
  return "" unless @position
  length = array.length
  return " in file #{array[2]}, line #{array[1]}, word #{array[0]}" if array[2]
  return " on line #{array[1]}, word #{array[0]}" if array[1]
  return " at word #{array[0]}" if array[0]
  raise "junk position given to exception"
end