Module: Enumerable

Defined in:
lib/each_with_anim.rb

Instance Method Summary collapse

Instance Method Details

#each_with_anim(kind = 0) ⇒ Object Also known as: each_with_animation



4
5
6
7
8
9
10
11
12
# File 'lib/each_with_anim.rb', line 4

def each_with_anim(kind=0)
  return enum_for(__method__) unless block_given?
  array_size = self.length
  @start_time, @before_size  = Time.now, 0 
  self.each_with_index do |elem,i|
    make_animation(i,array_size,kind)
    yield elem
  end
end