alexpeachey / end_state

A State Machine implementation
MIT License
9 stars 5 forks source link

Add MissingParams custom error for require_params #34

Closed brianvh closed 8 years ago

brianvh commented 8 years ago

This PR is for issue #33.

My goal was to modify the existing style in Transition as little as possible, but there's definitely an opportunity to reconstruct the behavior around the missing_params(params) method. At the very least, something like a params_missing? predicate to replace missing_params(params).empty?. I'm open to extending this PR to include that, if we think it's acceptable.

Also, I've moved the error class definitions over to a more directed style, to remove the 1-line class statements. The generally accepted better practice is to use Class.new() to define a proper named constant that depends from an existing defined class/constant. I also think it reads as much cleaner.

brianvh commented 8 years ago

I'm not familiar with travis.ci, so I have no idea why the install of the gem (which is actually contained in the repo) would fail. Hopefully, that's a simple fix, but it looks to be totally out of my hands. The full test suite runs, just fine, from a local install…

alexpeachey commented 8 years ago

This looks good @brianvh. Thanks for putting this together. Don't worry about Travis. I looked into it before and there is some issue with a version of something they are using. I can't remember the details at the moment but I'll look into again real quick to see if it can be resolved with a config tweak or version bump on something.

Otherwise I'll get this added in soon.

alexpeachey commented 8 years ago

This was squash-merged and made part of v1.1.0.