Sha256: 107dc2290e576aa4b761b2d73f2f60ef30ee957233a64a0575f4cbacd9f6fedc

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

require 'polling/version'
require 'polling/confirm'
require 'polling/sleep'
require 'polling/target'

module Polling
  module_function
  def run(arr, debug=false)
    start = true
    arr = Confirm::check_arr(arr)
    loop do 
      arr.each do |time|
        time = Confirm::check_value(time)
        Sleep::exec Target::interval(0, debug) if start
        Sleep::exec Target::interval(time, debug) unless start
        start = false
        yield
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polling-0.0.3 lib/polling.rb