Class: Jets::Lambda::Function
- Defined in:
- lib/jets/lambda/function.rb
Instance Attribute Summary
Attributes inherited from Functions
Class Method Summary collapse
- .handler ⇒ Object
- .handler_definition ⇒ Object
-
.process(event, context, meth) ⇒ Object
Used by main_processor.rb.
Instance Method Summary collapse
-
#initialize ⇒ Function
constructor
Override and change the signature so we do not have to provide info at initialization.
Methods inherited from Functions
#_normalize_options, _prefixes, abstract!, inherited, output_keys, subclasses
Methods included from Util::Logging
Methods included from Dsl
Constructor Details
#initialize ⇒ Function
Override and change the signature so we do not have to provide info at initialization. So:
hello_function = HelloFunction.new
hello_function.lambda_handler(event, context)
Normally controller and job functions initialize like this:
controller = PostController.new(event, context, "handler_handler")
12 13 |
# File 'lib/jets/lambda/function.rb', line 12 def initialize end |
Class Method Details
.handler ⇒ Object
15 16 17 |
# File 'lib/jets/lambda/function.rb', line 15 def self.handler handler_definition.meth end |
.handler_definition ⇒ Object
19 20 21 |
# File 'lib/jets/lambda/function.rb', line 19 def self.handler_definition definitions.first end |
.process(event, context, meth) ⇒ Object
Used by main_processor.rb. Same interface as controllers and jobs.
24 25 26 27 |
# File 'lib/jets/lambda/function.rb', line 24 def self.process(event, context, meth) function = new function.send(handler, event, context) end |