Method: Enumerable#map_with_index
- Defined in:
- lib/util.rb
#map_with_index ⇒ Object
sigh…
12 13 14 15 16 |
# File 'lib/util.rb', line 12 def map_with_index # sigh... ret = [] each_with_index { |e, i| ret << yield(e, i) } ret end |
sigh…
12 13 14 15 16 |
# File 'lib/util.rb', line 12 def map_with_index # sigh... ret = [] each_with_index { |e, i| ret << yield(e, i) } ret end |