Sha256: 229899168f2cbfc06ca0cd28693a0482ec68caf45db2b2c05f1d96398ca37a0e

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

require 'attempt_this/attempt_object.rb'

module AttemptThis
  extend self

  # Attempts code block until it doesn't throw an exception or the end of enumerator has been reached.
  def attempt(enumerator, &block)
    raise(ArgumentError, 'Nil enumerator!') if enumerator.nil?

    impl = AttemptObject::get_object(enumerator)
    impl.attempt(block)
  end

  # Resets all static data (scenarios). This is intended to use by tests only (to reset scenarios)
  def self.reset
    AttemptObject.reset
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
attempt_this-0.9.1 lib/attempt_this/attempt_this.rb