class Rack::Shelf::Base64ResponseAdapter

Transforms a standard Rack response array to a return value required by AWS Lambda. Encodes the response body as base-64. This is typically used for sending binary data (not text).

Public Instance Methods

build() click to toggle source

Constructs the AWS Lambda response. @return [Hash]

Calls superclass method
# File lib/rack/shelf/base64_response_adapter.rb, line 15
def build
  super.merge('isBase64Encoded' => true)
end

Private Instance Methods

body() click to toggle source

Constructs the response body encoded in base-64. @return [String]

Calls superclass method
# File lib/rack/shelf/base64_response_adapter.rb, line 23
def body
  Base64.encode64(super)
end