Module: Hanami::Lambda Private
- Defined in:
- lib/hanami/lambda.rb,
lib/hanami/lambda/rack.rb,
lib/hanami/lambda/event.rb,
lib/hanami/lambda/types.rb,
lib/hanami/lambda/version.rb,
lib/hanami/lambda/function.rb,
lib/hanami/lambda/dispatcher.rb,
lib/hanami/lambda/application.rb,
lib/hanami/lambda/events/base.rb,
lib/hanami/lambda/events/event_bridge.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Make Hanami can be run on AWS Lambda.
Defined Under Namespace
Modules: Application, Events, Types Classes: Dispatcher, Event, Function, Rack
Constant Summary collapse
- LAMBDA_EVENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"lambda.event"
- LAMBDA_CONTEXT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"lambda.context"
- LAMBDA_CONFIG_PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
File.join("config", "lambda")
- LAMBDA_CLASS_NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"Lambda"
- VERSION =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"0.2.4"
- HANDLER_KEY_NAMESPACE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"functions"
Class Method Summary collapse
-
.app ⇒ Hanami::Lambda::Application
Return the application.
-
.call(event:, context:) ⇒ Object
Run the application.
- .gem_loader ⇒ Object private
-
.inflector ⇒ Dry::Inflector
private
Inflector to convert event key.
Class Method Details
.app ⇒ Hanami::Lambda::Application
Return the application
35 36 37 |
# File 'lib/hanami/lambda.rb', line 35 def self.app Hanami.app end |
.call(event:, context:) ⇒ Object
Run the application
42 43 44 45 46 |
# File 'lib/hanami/lambda.rb', line 42 def self.call(event:, context:) require "bundler/setup" app.boot app.handle_lambda(event: event, context: context) end |
.gem_loader ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/hanami/lambda.rb', line 66 def self.gem_loader @gem_loader ||= Zeitwerk::Loader.new.tap do |loader| root = File.("..", __dir__ || "") loader.tag = "hanami-lambda" loader.inflector = Zeitwerk::GemInflector.new("#{root}/hanami-lambda.rb") loader.push_dir(root) loader.ignore( "#{root}/hanami-lambda.rb", "#{root}/hanami/lambda/{rake_tasks,version}.rb", "#{root}/hanami/lambda/support" ) loader.inflector.inflect("lambda" => "Lambda") end end |
.inflector ⇒ Dry::Inflector
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Inflector to convert event key
54 55 56 57 58 59 60 61 62 |
# File 'lib/hanami/lambda.rb', line 54 def self.inflector @_mutex.synchronize do return @inflector if defined?(@inflector) @inflector ||= Dry::Inflector.new end @inflector end |