Closed charlierudolph closed 9 years ago
Overall I like this separation.
I think it's a good start and likely will open up some additional cuts and pieces that we can carve out.
One example might be a class called something (lame default name TransitionConfigurations
) that is just a wrapper around the hash that is transition_configurations
. It would have a method that basically does the work of __sm_transition_configuration_for
. So StateMachine would still have transition_configurations
but it would be an instance of this new class instead of a Hash. It seems odd to use this hash and use it like a hash except in an edge case. By wrapping it up in a class it starts to make more sense and the machine doesn't have to understand the specifics of the edge case.
There are probably others that will start to manifest as we look at the new complete code set.
Messages fixed. Will need to add tests for the matchers as they would be broken (changing transitions to transition_configurations)
@alexpeachey updated. See the code climate diff here
@alexpeachey bump
Thanks @charlierudolph. I think this looks good and at least from what I can see doesn't appear to change the API so I'm merging this. I'm not cutting a new version as this is just a refactoring.
@alexpeachey @brianvh please review