-
Notifications
You must be signed in to change notification settings - Fork 2
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
wrong number of arguments (given 1, expected 0) (ArgumentError) #3
Comments
it seems you can check whether a method requires arguments with: def test; end
method(:test).parameters |
Ok, I've modified your code to support it. I have no experience with rspec and building a test will probably take me more work, but I've got something that works. Please check if you like it and whether it's usefull for you. |
Please see my pull request #4 |
hey @TvL2386 - i'll take a look at the pull request later on in the week. |
@kklimuk finished that workweek? |
how about now? |
Hi kklimuk,
Thanks for your awesome blog post and this nifty piece of software.
I've been solving this problem countless times as well. I like your implementation! Specifically because you can just toggle it on and off where you like.
The issue I have is minor and I see why it happens. When I memoize a method that does not have arguments, it doesn't work, see example:
Output:
I understand it has to do with your scoped support. It would be great if this could be solved or if another memoization method could be added for this scenario.
Thanks for the big explanation. I can definitely use your code to implement exactly what I need, but maybe ruby_memoized could be even better (imho).
Kind regards,
TvL2386
The text was updated successfully, but these errors were encountered: