Sha256: 3e99438fe7a1f53fbbae14a92c9122ec7c1d66a064dd33c914fd025dfe709e77

Contents?: true

Size: 528 Bytes

Versions: 2

Compression:

Stored size: 528 Bytes

Contents

module PbSyringe
  module Progressable
    attr_accessor :progress_unit

    def progress_start(**options)
      return if PbSyringe.suppress?
      progress_unit.start(**options) if progress_unit
      return unless block_given?
      yield
      progress_finish
    end

    def progress_finish
      return if PbSyringe.suppress?
      progress_unit.finish if progress_unit
    end

    def progress_increment(count)
      return if PbSyringe.suppress?
      progress_unit.increment(count) if progress_unit
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pb_syringe-0.1.1 lib/pb_syringe/progressable.rb
pb_syringe-0.1.0 lib/pb_syringe/progressable.rb