Skip to content

Conversation

@jgaskins
Copy link

In addition to passing a Proc as a value, this PR allows us to pass a first-class block to Crambda.run_handler:

Crambda.run_handler do |event, context|
  { foo: "bar", omg: "lol", wtf: 42 }
end

Notice that we don't even need to return a JSON::Any explicitly — we can pass anything that responds to to_json.

In addition to passing a `Proc` as a value, this commit allows us to
pass a first-class block to `Crambda.run_handler`:

    Crambda.run_handler do |event, context|
      { foo: "bar", omg: "lol", wtf: 42 }
    end
@mhart
Copy link
Member

mhart commented Dec 24, 2018

This is great! I removed the block signature back in a4dbb0f#diff-04c6e90faac2675aa89e2176d2eec7d8L27 –  but I should've kept both.

Can you update the documentation so that it mentions both forms? The existing form matches AWS' Ruby runtime, which I think is still worth pointing out.

@ErikAGriffin
Copy link

Is this project still live?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants