bugsnag / bugsnag-ruby

BugSnag error monitoring & reporting software for rails, sinatra, rack and ruby
https://docs.bugsnag.com/platforms/ruby
MIT License
248 stars 173 forks source link

Add `set_user` to Report/Event #696

Closed imjoehaines closed 3 years ago

imjoehaines commented 3 years ago

Goal

Adds a set_user method, with the same API as other notifiers e.g. @bugsnag/js:

report.set_user("123", "abc.xyz@example.com", "abc xyz")
# { id: "123", email: "abc.xyz@example.com", name: "abc xyz" }

# passing 'nil' removes that field
report.set_user("123", nil, "abc xyz")
# { id: "123", name: "abc xyz" }

# passing nothing removes all user data
report.set_user
# {}