-
Notifications
You must be signed in to change notification settings - Fork 23
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
Patch for optional callback arguments? #18
Comments
I'm a very open person - can you explain what you mean with an example? |
I have some hook methods that require an argument to be passed, and others that don't. I could just make them accept the argument, but they're used outside of hooks also so it doesn't really fit. |
Actually don't worry about this, I've just restructured some code so this isn't a issue. Cheers. |
Ok. I thought about it and decided to leave it as it is. Usually, people who write hook callbacks can do this if they're not interested in arguments. def after_initialize(*) In your case, you seem to reuse a method for both API and as a hook callback (which is good). I just don't understand why you would send parameters to the hook, then? |
Yeah I know what you mean, I was migrating old code to use your gem some of which was block callbacks expecting the first parameter to be the scope object, rather than setting it to Thanks :) |
Great gem - exactly what I was looking for.
I had to modify it slightly though to allow callbacks to take optional arguments, rather than passing them through to every callback. Would you accept a patch with that behaviour?
The text was updated successfully, but these errors were encountered: