Exception: Sandbox::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/sandbox/errors.rb

Instance Method Summary collapse

Methods inherited from Error

#message

Constructor Details

#initialize(reason = nil, args = []) ⇒ ParseError

Returns a new instance of ParseError.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/sandbox/errors.rb', line 24

def initialize(reason=nil, args=[])
  msg = if args.is_a?(Array) && args.size > 0
    "#{reason} => #{args.join( ' ' )}"
  elsif args.is_a?(String) && args.length > 0
    "#{reason} => #{args}"
  else
    reason
  end

  super(msg)
end