Exception: Typed::Validations::TypeMismatchError

Inherits:
ValidationError show all
Extended by:
T::Sig
Defined in:
lib/typed/validations/type_mismatch_error.rb

Instance Method Summary collapse

Methods inherited from DeserializeError

#to_h, #to_json

Methods inherited from SerializationError

#to_h, #to_json

Constructor Details

#initialize(field_name:, field_type:, given_type:) ⇒ TypeMismatchError

Returns a new instance of TypeMismatchError.



9
10
11
# File 'lib/typed/validations/type_mismatch_error.rb', line 9

def initialize(field_name:, field_type:, given_type:)
  super("Invalid type given to #{field_name}. Expected #{field_type}, got #{given_type}.")
end