Class: Valvat::LookupError

Inherits:
Error
  • Object
show all
Defined in:
lib/valvat/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, kind) ⇒ LookupError

Returns a new instance of LookupError.



7
8
9
10
11
# File 'lib/valvat/error.rb', line 7

def initialize(message, kind)
  @message = message.to_s
  @kind = kind.is_a?(Class) ? kind.name.split('::').last : kind.to_s
  super(@message)
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/valvat/error.rb', line 17

def eql?(other)
  to_s.eql?(other.to_s)
end

#to_sObject



13
14
15
# File 'lib/valvat/error.rb', line 13

def to_s
  "The #{@kind} web service returned the error: #{@message}"
end