Examples of the methods provided by Enumerable
puts [1,2,3,4].collect { |i| i.to_s + "x" }
puts [1,2,3,4].detect { |i| i.between?(2,3) }
puts [1,2,3,4].select { |i| i.between?(2,3) }
puts [4,1,3,2].sort
puts [1,2,3,4].max
puts [1,2,3,4].min
Related examples in the same category