Class: Apiculture::ParameterTypeMismatch
- Inherits:
-
ValidationError
- Object
- Apiculture::ParameterTypeMismatch
- Defined in:
- lib/apiculture.rb
Overview
Gets raised when a parameter is supplied and has a wrong type
Instance Method Summary collapse
-
#initialize(ac_parameter, received_ruby_type) ⇒ ParameterTypeMismatch
constructor
A new instance of ParameterTypeMismatch.
Constructor Details
#initialize(ac_parameter, received_ruby_type) ⇒ ParameterTypeMismatch
Returns a new instance of ParameterTypeMismatch.
145 146 147 148 149 |
# File 'lib/apiculture.rb', line 145 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 |