Method: Grape::Namespace#initialize

Defined in:
lib/grape/namespace.rb

#initialize(space, options) ⇒ Namespace

Returns a new instance of Namespace.

Parameters:

  • space (String)

    the name of this namespace

  • options (Hash)

    options hash

Options Hash (options):

  • :requirements (Hash)

    param-regex pairs, all of which must be met by a request’s params for all endpoints in this namespace, or validation will fail and return a 422.



15
16
17
18
# File 'lib/grape/namespace.rb', line 15

def initialize(space, options)
  @space = space.to_s
  @options = options
end