Class: Apiculture::ParameterTypeMismatch

Inherits:
ValidationError
  • Object
show all
Defined in:
lib/apiculture.rb

Overview

Gets raised when a parameter is supplied and has a wrong type

Instance Method Summary collapse

Constructor Details

#initialize(ac_parameter, received_ruby_type) ⇒ ParameterTypeMismatch

Returns a new instance of ParameterTypeMismatch.



147
148
149
150
151
# File 'lib/apiculture.rb', line 147

def initialize(ac_parameter, received_ruby_type)
  parameter_name, expected_type = ac_parameter.name, ac_parameter.matchable
  received_type = received_ruby_type
  super "Received #{received_type}, expected #{expected_type.inspect} for :#{parameter_name}"
end