Class: Lamby::Rack

Inherits:
Object
  • Object
show all
Includes:
SamHelpers
Defined in:
lib/lamby/rack.rb

Direct Known Subclasses

RackAlb, RackHttp, RackRest

Constant Summary collapse

LAMBDA_EVENT =
'lambda.event'.freeze
LAMBDA_CONTEXT =
'lambda.context'.freeze
HTTP_X_REQUESTID =
'HTTP_X_REQUEST_ID'.freeze
'HTTP_COOKIE'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SamHelpers

#sam_local?

Constructor Details

#initialize(event, context) ⇒ Rack

Returns a new instance of Rack.



13
14
15
16
# File 'lib/lamby/rack.rb', line 13

def initialize(event, context)
  @event = event
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



11
12
13
# File 'lib/lamby/rack.rb', line 11

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



11
12
13
# File 'lib/lamby/rack.rb', line 11

def event
  @event
end

Instance Method Details

#envObject



18
19
20
# File 'lib/lamby/rack.rb', line 18

def env
  @env ||= env_base.merge!(env_headers)
end

#multi_value?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/lamby/rack.rb', line 26

def multi_value?
  false
end

#response(_handler) ⇒ Object



22
23
24
# File 'lib/lamby/rack.rb', line 22

def response(_handler)
  {}
end