Method: Enumerable::Progress#method_missing

Defined in:
lib/vex/base/enumerable/progress.rb

#method_missing(sym, *args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vex/base/enumerable/progress.rb', line 10

def method_missing(sym, *args)
  return @base.send(sym, *args) unless block_given?

  r = @base.send sym, *args do |*args|
    begin
      yield *args
    ensure
      @idx += 1
      on_progress(@idx, @count)
    end
  end
end