Exception: Pablo::WrongArgumentError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/pablo/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, arg = nil, type = nil) ⇒ WrongArgumentError

Returns a new instance of WrongArgumentError.



39
40
41
# File 'lib/pablo/errors.rb', line 39

def initialize name, arg = nil, type = nil
    @name, @arg, @type = name, arg, type
end

Instance Method Details

#to_sObject



43
44
45
46
47
48
49
50
# File 'lib/pablo/errors.rb', line 43

def to_s
    (@arg ?
        "Wrong argument '#{@arg}' for '#{@name}'." :
        "Wrong argument for '#{@name}'.") +
    (@type ?
        " Expected #{@type}." :
        '')
end