Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How can I run enumberable
- and only do min_by on a collection with
- certain other variables met?
- Example..
- @array.min_by{|ele| ele[:failed] < MaxFailedAllowed ; ele[:last_used] } #<--- in this instance I really want
- the lowest :last_used element, but only if its less that max failed as well.. do I have to do
- a find_all to collect the first elements then do a min_by on that? or is there
- a way to combine the 2 comparisons?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement