-
Notifications
You must be signed in to change notification settings - Fork 487
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
New methods to retrieve 1 or more guards from the list of running guards #121
Comments
Another idea comes to mind: don't even use a separately named helper, just implement |
Very smart indeed! :) Sent from my iPhone On 14 août 2011, at 23:36, ches reply@reply.github.com wrote:
|
Ok, I've now implemented a first version of your suggestion.
Thanks again @ches! |
Awesome! Hope I can find a chance to play with it soon. Thanks for hearing suggestions and implementing them :-) |
No problem, it's always a pleasure. And you're acknowledged in the CHANGELOG! ;) |
An awfully generous credit, thanks :-) |
Aha, everyone should be thanked, regardless of the contribution's impact (and it's free so... :D)! |
As discussed in #118, we could "add a little helper method to Guard that allows you to get a guard like
Guard.get_guard(:less)
" (@netzpirat).I agree with @ches on "using a hash instead of keyword arguments", as it seems to be the best choice. We could even have 2 methods:
Guard.get_guards(filters={})
(return an array of guards)and
Guard.get_guard(filters={})
(return the first guard that matches).with
filters
a hash like this:{ :name => :less, :group => :foobar }
(this would return only the guard-less that is present in the "foobar" group).Thoughts welcome!
The text was updated successfully, but these errors were encountered: