-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow multiple states to be defined on one line #288
Conversation
@HParker Thanks for the pull request, which looks great so far (and I'm looking forward to merge it). A couple of things though:
Regarding the README, I'm happy to take your change (and maybe add a comment later). |
if args.last.is_a?(Hash) && args.size == 2 | ||
names = [args.first] | ||
options = args.last | ||
elsif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a condition missing here?
looks good, thanks @HParker - will definitely use that when merged :-) |
…_line - also fix typo and move arg deconstruction to private method
I just released version |
resolves #146
I don't know if anyone still wants it, but it was straight forward enough to add.
I hope you don't mind I coopted the first example in the readme to show the new syntax. I am happy to change that if you prefer it done differently.
Question: The issue also mentioned being able to refer to multiple states by
states
rather thanstate
in theaasm
block, howeverstates
as defined in base is already accessible from that scope as we just instance_eval the block against the base class. I was wondering if you would be open to scoping the methods that are callable from the aasm block to some subset of the methods in base. I am happy to create an issue and take a look.