Sha256: 9deaa103f3fc7dd9e30382862e4753f288bf8074dd56b8e94c3c548e2c743197

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

Every Now And Then
==================

It's quite simple, really - it lets you do something every specified interval of time. When supplied with a block, it
yields the iteration count (starts at zero).

It requires 'active_support/time', so as to allow time intervals to be specified as 5.seconds, 6.7.days, etc. The 'every'
method accepts integers or floats.

If the operation inside the block takes longer than the specified interval, then the next iteration will begin
immediately after the last.

To exit, simply break out of the loop.

Examples
========

    require 'enat'

    every 4.2.minutes do |i|
      puts "wheee! i've done this #{i} times!"
      break if i > 5
    end

Installation
============

    $ gem install enat

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enat-0.1.1 README.markdown