Module: ActiveFunction::Functions::Response

Defined in:
lib/active_function/functions/response.rb

Overview

The only required plugin for Base to work. Provides a simple Response object to manage response details.

Examples:

response = Response.new.tap do |r|
  r.body = "Hello World!"
  r.headers = {"Content-Type" => "text/plain"}
  r.commit!
end

response.performed? # => true
response.to_h # => { statusCode: 200, headers: { "Content-Type" => "text/plain" }, body: "Hello World!" }

Defined Under Namespace

Classes: Response