Exception: Omnibus::InvalidValue

Inherits:
Error
  • Object
show all
Defined in:
lib/omnibus/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(source, message) ⇒ InvalidValue

Returns a new instance of InvalidValue.

Parameters:

  • source (Symbol)

    the source method that received an invalid value

  • message (String)

    the message about why the value is invalid



163
164
165
166
# File 'lib/omnibus/exceptions.rb', line 163

def initialize(source, message)
  @source  = source
  @message = message
end

Instance Method Details

#to_sObject



168
169
170
171
172
# File 'lib/omnibus/exceptions.rb', line 168

def to_s
  <<~EOH
    Invalid value for `#{@source}'. Expected #{@source} to #{@message}!
  EOH
end