Class: LambdaOpenApi::Invoker

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_open_api/invoker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass:, method:, event:, context:) ⇒ Invoker

Returns a new instance of Invoker.



6
7
8
# File 'lib/lambda_open_api/invoker.rb', line 6

def initialize(klass:, method:, event:, context:)
  @response = klass.send(method || "process", event: event, context: context)
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



4
5
6
# File 'lib/lambda_open_api/invoker.rb', line 4

def response
  @response
end

Instance Method Details

#response_bodyObject



10
11
12
13
# File 'lib/lambda_open_api/invoker.rb', line 10

def response_body
  return unless response
  response["body"] || response[:body] || response
end