Class: Jets::Controller::Rack::Env
- Inherits:
-
Object
- Object
- Jets::Controller::Rack::Env
- Defined in:
- lib/jets/controller/rack/env.rb
Instance Method Summary collapse
- #convert ⇒ Object
-
#initialize(event, context, options = {}) ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize(event, context, options = {}) ⇒ Env
Returns a new instance of Env.
8 9 10 |
# File 'lib/jets/controller/rack/env.rb', line 8 def initialize(event, context, ={}) @event, @context, @options = event, context, end |
Instance Method Details
#convert ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jets/controller/rack/env.rb', line 12 def convert = {} = add_top_level() = add_http_headers() path = path_with_base_path || @event['path'] || '/' # always set by API Gateway but might not be when testing shim, so setting it to make testing easier env = Rack::MockRequest.env_for(path, ) if @options[:adapter] env['adapter.event'] = @event env['adapter.context'] = @context end env end |