Sha256: 14133bf27586e9d410d132607bb1bc38297526a370d418bab5b1d14c51e97644

Contents?: true

Size: 268 Bytes

Versions: 1

Compression:

Stored size: 268 Bytes

Contents

# encoding: utf-8

class Promise
  module Progress
    def on_progress(block)
      (@on_progress ||= []) << block
    end

    def progress(status)
      if pending? && @on_progress
        @on_progress.each { |block| block.call(status) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
promise.rb-0.1.0 lib/promise/progress.rb