Class: Grape::Middleware::Globals

Inherits:
Base
  • Object
show all
Defined in:
lib/grape/middleware/globals.rb

Instance Attribute Summary

Attributes inherited from Base

#app, #env, #options

Instance Method Summary collapse

Methods inherited from Base

#after, #call, #call!, #content_type, #content_type_for, #content_types, #default_options, #initialize, #mime_types, #response

Constructor Details

This class inherits a constructor from Grape::Middleware::Base

Instance Method Details

#beforeObject



6
7
8
9
10
# File 'lib/grape/middleware/globals.rb', line 6

def before
  @env['grape.request'] = Grape::Request.new(@env)
  @env['grape.request.headers'] = request.headers
  @env['grape.request.params'] = request.params if @env['rack.input']
end