Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Adding Payload class to manage access to webhook payload #136

Merged
merged 2 commits into from
Apr 13, 2018

Conversation

davidalber
Copy link
Collaborator

This PR adds a class -- Payload -- to manage the access to the payload contents. At this point, it looks completely superfluous since all it's doing is forcing a bunch of changes in how we index into the payload, but this is setting the stage for further work on #72, which is going to require changes in the payload behavior.

Previously we would index the payload like you normally index into a dict: payload['a']['b']['c']. In the Payload object you index as payload['a', 'b', 'c'].

A syntactically nicer alternative involves using properties (e.g., payload.a.b.c). I implemented this first, but it was quite a bit more code, although it did have other niceties. I could make it shorter, but then decided to keep it simple. For that implementation, you can see the Payload class here and it being used here, for example.

@nrc nrc merged commit cc95d2e into rust-lang:master Apr 13, 2018
@nrc
Copy link
Member

nrc commented Apr 13, 2018

Looks good, thanks!

@davidalber davidalber deleted the payload-object branch April 13, 2018 08:01
@nrc nrc mentioned this pull request Apr 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants