Exception: Otoroshi::TypeError

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

Overview

Manages errors raised when value is not an instance of the expected class

Instance Method Summary collapse

Constructor Details

#initialize(property, type) ⇒ TypeError

Returns a new instance of TypeError.

Examples:

":number is not an instance of Integer"

Parameters:

  • property (Symbol)

    name of the property

  • type (Class)

    class to match



14
15
16
# File 'lib/otoroshi/exceptions.rb', line 14

def initialize(property, type)
  super ":#{property} is not an instance of #{type}"
end