Class: Jets::Controller::Middleware::Local::MimicAwsCall
- Inherits:
-
Object
- Object
- Jets::Controller::Middleware::Local::MimicAwsCall
- Extended by:
- Memoist
- Defined in:
- lib/jets/controller/middleware/local/mimic_aws_call.rb
Instance Method Summary collapse
- #context ⇒ Object
-
#controller ⇒ Object
Actual controller instance.
- #event ⇒ Object
-
#initialize(route, env) ⇒ MimicAwsCall
constructor
A new instance of MimicAwsCall.
- #meth ⇒ Object
- #vars ⇒ Object
Constructor Details
#initialize(route, env) ⇒ MimicAwsCall
Returns a new instance of MimicAwsCall.
5 6 7 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 5 def initialize(route, env) @route, @env = route, env end |
Instance Method Details
#context ⇒ Object
34 35 36 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 34 def context @env['adapter.context'] || {"fake" => "context in mimic_aws_call.rb"} end |
#controller ⇒ Object
Actual controller instance
19 20 21 22 23 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 19 def controller controller_class = @route.controller_name.constantize meth = @route.action_name controller_class.new(event, context, meth) end |
#event ⇒ Object
29 30 31 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 29 def event @env['adapter.event'] || ApiGateway.new(@route, @env).event end |
#meth ⇒ Object
25 26 27 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 25 def meth @route.action_name end |
#vars ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/jets/controller/middleware/local/mimic_aws_call.rb', line 9 def vars { 'jets.controller' => controller, 'lambda.context' => context, 'lambda.event' => event, 'lambda.meth' => meth, } end |