Sha256: 8125c5328fa5f9892b0929f312b3e73b8d1b7577ecff33c619c7446b25b4917f
Contents?: true
Size: 328 Bytes
Versions: 1
Compression:
Stored size: 328 Bytes
Contents
require 'attempt_this/attempt_object.rb' module AttemptThis # 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.new(enumerator) impl.attempt(block) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
attempt_this-0.8.1 | lib/attempt_this.rb |