Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/milkode/cdweb/app.rb

Instance Method Summary collapse

Instance Method Details

#map_with_index(&block) ⇒ Object



148
149
150
# File 'lib/milkode/cdweb/app.rb', line 148

def map_with_index(&block)
  dup.map_with_index!(&block)
end

#map_with_index!Object



144
145
146
# File 'lib/milkode/cdweb/app.rb', line 144

def map_with_index!
  each_with_index do |e, idx| self[idx] = yield(e, idx); end
end