Skip to content

Commit

Permalink
Update readme to use procs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmorrison committed Jan 11, 2025
1 parent 46bea71 commit 4336d84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ For example, we can add hooks in an initializer:

```ruby
# Make IP address accessible to the handlers
Rails.application.config.twirp.service_hooks[:before] = lambda do |rack_env, env|
Rails.application.config.twirp.service_hooks[:before] = proc do |rack_env, env|
env[:ip] = rack_env["REMOTE_ADDR"]
end

# Send exceptions to Honeybadger
Rails.application.config.twirp.service_hooks[:exception_raised] = ->(exception, _env) { Honeybadger.notify(exception) }
Rails.application.config.twirp.service_hooks[:exception_raised] = proc {|exception, _env| Honeybadger.notify(exception) }
```

### Middleware
Expand Down

0 comments on commit 4336d84

Please sign in to comment.