Class: Lamby::Rack

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

Direct Known Subclasses

RackAlb, RackApi

Constant Summary collapse

LAMBDA_EVENT =
'lambda.event'.freeze
LAMBDA_CONTEXT =
'lambda.context'.freeze
HTTP_X_REQUESTID =
'HTTP_X_REQUEST_ID'.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.



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

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

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



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

def event
  @event
end

Instance Method Details

#alb?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/lamby/rack.rb', line 29

def alb?
  false
end

#api?Boolean

Returns:

  • (Boolean)


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

def api?
  false
end

#envObject



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

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

#multi_value?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/lamby/rack.rb', line 33

def multi_value?
  false
end

#response(_handler) ⇒ Object



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

def response(_handler)
  {}
end