spyke icon indicating copy to clipboard operation
spyke copied to clipboard

bang methods

Open samandmoore opened this issue 7 years ago • 1 comments

Hi there,

I'm curious if you'd be open to a PR (or possibly a few PRs) to add a suite of bang methods like #save!, .create!. These methods would provide the same base behavior as their non-bang versions but in the event of a local or remote validation error, they would raise a special exception, e.g. ResourceNotValid. These bang methods are intended to be the equivalent of the ActiveRecord bang methods.

At Betterment we use the Her gem quite a bit and have actually privately forked it and extended it with a lot of functionality, specifically including these bang methods. I'd like to try to migrate off of Her and onto Spyke. This change would go a long way to making Spyke work for our use-cases.

Thanks for creating this library and thanks for your time!

samandmoore avatar Jun 19 '17 01:06 samandmoore

@samandmoore adding those sounds reasonable to me! Thanks for checking out the gem :)

balvig avatar Jun 19 '17 05:06 balvig