Method: Grape::DSL::InsideRoute#declared

Defined in:
lib/grape/dsl/inside_route.rb

#declaredObject

A filtering method that will return a hash consisting only of keys that have been declared by a ‘params` statement against the current/target endpoint or parent namespaces.

options. ‘:include_parent_namespaces` defaults to true, hence must be set to false if you want only to return params declared against the current/target endpoint.

Parameters:

  • params (Hash)

    The initial hash to filter. Usually this will just be ‘params`

  • options (Hash)

    Can pass ‘:include_missing`, `:stringify` and `:include_parent_namespaces`

Raises:

See Also:

  • Grape::DSL::InsideRoute.+PostBeforeFilter+PostBeforeFilter#declared+


149
150
151
# File 'lib/grape/dsl/inside_route.rb', line 149

def declared(*)
  raise MethodNotYetAvailable, '#declared is not available prior to parameter validation.'
end