Sha256: 76e68f769c26c20677e4f434f8a8c73cb58252cec690b74ab9eb37a8c0513cdc

Contents?: true

Size: 852 Bytes

Versions: 14

Compression:

Stored size: 852 Bytes

Contents

module Soaspec
  # Ways of repeating an exchange to reach a desired outcome
  module ExchangeRepeater
    # Wait until the passed block returns true
    # @param [Hash] opts Options for this instance
    # @option opts [Numeric] :timeout (5) Seconds to wait before timing out.
    # @option opts [Numeric] :interval (0.2) Seconds to sleep between polls.
    # @option opts [String] :message Exception message if timed out.
    # @option opts [Array, Exception] :ignore Exceptions to ignore while polling (default: Error::NoSuchElementError)
    # @return [Self] Returns itself so operations can be done on the exchange after it's done waiting
    def until(opts = {}, &script)
      Soaspec::Wait.until(opts) do
        @response = nil # Reset response so it can be made repeatedly
        instance_eval(&script)
      end
      self
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
soaspec-0.2.25 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.23 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.22 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.21 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.20 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.19 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.18 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.17 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.16 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.15 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.14 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.13 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.12 lib/soaspec/exchange/exchange_repeater.rb
soaspec-0.2.11 lib/soaspec/exchange/exchange_repeater.rb