Exception: Otoroshi::Collection::TypeError

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

Overview

Manages errors raised when at least one element of the collection 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:

":numbers contains elements that are not instances of Integer"

Parameters:

  • property (Symbol)

    name of the property

  • type (Class)

    class to match



60
61
62
# File 'lib/otoroshi/exceptions.rb', line 60

def initialize(property, type)
  super ":#{property} contains elements that are not instances of #{type}"
end