Module: PapermillArrayExtensions

Defined in:
lib/papermill/extensions.rb

Instance Method Summary collapse

Instance Method Details

#map_with_index(&block) ⇒ Object



35
36
37
# File 'lib/papermill/extensions.rb', line 35

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

#map_with_index!Object



31
32
33
# File 'lib/papermill/extensions.rb', line 31

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