Class: Lamby::Rack
- Inherits:
-
Object
- Object
- Lamby::Rack
- Defined in:
- lib/lamby/rack.rb
Constant Summary collapse
- LAMBDA_EVENT =
'lambda.event'.freeze
- LAMBDA_CONTEXT =
'lambda.context'.freeze
- HTTP_X_REQUESTID =
'HTTP_X_REQUEST_ID'.freeze
- HTTP_X_REQUEST_START =
'HTTP_X_REQUEST_START'.freeze
- HTTP_COOKIE =
'HTTP_COOKIE'.freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Class Method Summary collapse
- .lookup(type, event) ⇒ Object
-
.types ⇒ Object
Order is important.
Instance Method Summary collapse
- #env ⇒ Object
-
#initialize(event, context) ⇒ Rack
constructor
A new instance of Rack.
- #multi_value? ⇒ Boolean
- #response(_handler) ⇒ Object
Constructor Details
#initialize(event, context) ⇒ Rack
Returns a new instance of Rack.
27 28 29 30 |
# File 'lib/lamby/rack.rb', line 27 def initialize(event, context) @event = event @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
25 26 27 |
# File 'lib/lamby/rack.rb', line 25 def context @context end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
25 26 27 |
# File 'lib/lamby/rack.rb', line 25 def event @event end |
Class Method Details
.lookup(type, event) ⇒ Object
11 12 13 |
# File 'lib/lamby/rack.rb', line 11 def lookup(type, event) types[type] || types.values.detect { |t| t.handle?(event) } end |
Instance Method Details
#env ⇒ Object
32 33 34 |
# File 'lib/lamby/rack.rb', line 32 def env @env ||= env_base.merge!(env_headers) end |
#multi_value? ⇒ Boolean
40 41 42 |
# File 'lib/lamby/rack.rb', line 40 def multi_value? false end |
#response(_handler) ⇒ Object
36 37 38 |
# File 'lib/lamby/rack.rb', line 36 def response(_handler) {} end |