Format Params as they're added to the resource#7
Open
yoshicoverhound wants to merge 1 commit intomasterfrom
Open
Format Params as they're added to the resource#7yoshicoverhound wants to merge 1 commit intomasterfrom
yoshicoverhound wants to merge 1 commit intomasterfrom
Conversation
For all values other than email and phone, the required format for the keys is very strange. I thought that this could be one way to improve this, or at least put more of this weirdness under the hood. Happy to update or get shot down if this isn't going to work, just an idea.
berfarah
suggested changes
Apr 18, 2017
Contributor
berfarah
left a comment
There was a problem hiding this comment.
@yoshicoverhound Good thinking. I have a few suggestions:
- Not all resources require these attributes. By putting this logic in the base-class it'll be tricky to work with anything that is not the Contact. Is there a reason you wanted it in
Resource? - It seems like parameter formatting is something that may evolve and have more complexity down the line. Do you mind extracting that into a class that handles formatting and validation?
- Gems will often have their own error type that wraps all internal errors so that the consumer can safely handle them. It might make sense to add a base
ActiveCampaignerror that inherits fromStandardError. - It looks like raising parameter errors could be a common use-case in the future. Do you think it makes sense to create a custom error class for this?
Author
|
thanks for the feedback @berfarah
|
Contributor
|
@yoshicoverhound Totes! You're right! Currently it's the only resource. That said, if we want to add more resources, it'd be good for them to be more general and have contact-specific stuff go there instead IMO. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For all values other than email and phone, the required format for the keys is very strange. I thought that this could be one way to improve this, or at least put more of this weirdness under the hood.
Happy to update or get shot down if this isn't going to work, just an idea.