Module: Ordinalizatron

Defined in:
lib/ordinalizatron.rb,
lib/ordinalizatron/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#each_with_ordinal_number(options = {}, &block) ⇒ Object



4
5
6
7
8
9
# File 'lib/ordinalizatron.rb', line 4

def each_with_ordinal_number(options = {}, &block)
  options.reverse_merge!(offset: find_offset)
  self.each_with_index do |element, index|
    yield(element, options[:offset] + index + 1)
  end
end