Flowdock
select() public

Returns a new array consisting of [key,value] pairs for which the block returns true. Also see Hash.values_at.

   h = { "a" => 100, "b" => 200, "c" => 300 }
   h.select {|k,v| k > "a"}  #=> [["b", 200], ["c", 300]]
   h.select {|k,v| v < 200}  #=> [["a", 100]]
Show source
Register or log in to add new notes.