Ruby allows you to peek into an element using parentheses in a block argument. select and map only assign one block argument, but you can look at the element:
array.select{|(x, y)| x == 1} # => [[1, 1], [1, 2], [1, 3]] array.select{|(x, y)| x == 1}.map{|(x, y)| y} # => [1, 2, 3]
You can omit the parentheses corresponding to the entire expression between |...| :
array.select{|x, y| x == 1} # => [[1, 1], [1, 2], [1, 3]] array.select{|x, y| x == 1}.map{|x, y| y} # => [1, 2, 3]
As an encoding style, the user can mark unused variables as _ :
array.select{|x, _| x == 1} # => [[1, 1], [1, 2], [1, 3]] array.select{|x, _| x == 1}.map{|_, y| y} # => [1, 2, 3]