Exception: ApiRecipes::PathParamsMismatch

Inherits:
Exception
  • Object
show all
Defined in:
lib/api_recipes/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, expected_params, provided_params) ⇒ PathParamsMismatch

Returns a new instance of PathParamsMismatch.



25
26
27
28
29
30
31
32
# File 'lib/api_recipes/exceptions.rb', line 25

def initialize(path, expected_params, provided_params)
  if expected_params.size == 0
    message = "route '#{path}' requires NO PARAMS but #{provided_params} were provided"
  else
    message = "route '#{path}' requires params #{expected_params} but #{provided_params} were provided"
  end
  super(message)
end