On Sat, Dec 3, 2016 at 2:44 PM, Guillaume Hivert <
guillaume.hivert / outlook.com> wrote:

> "Returns the first entry for which *block* is not false."
>


OH! I must have missed that when I read through the docs. I was under the
impression that it would return all entries where block is not false. so
here's my solution:

def first_under(array, limit)
  array.sort.reverse!
  array.find {|num| num < limit}
end

might not be the most elegant(and if there is a better way I would like to
know) but alas! it works and that's good enough (at least until I get to
the re-factoring section...)
thank you thank you!
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>