Module: Retriable

Extended by:
Retriable
Included in:
Retriable
Defined in:
lib/xamarin-test-cloud/retriable_options.rb

Instance Method Summary collapse

Instance Method Details

#retriable(opts = {}, &block) ⇒ Object

Raises:

  • (LocalJumpError)


34
35
36
37
38
39
40
41
42
43
44
# File 'lib/xamarin-test-cloud/retriable_options.rb', line 34

def retriable(opts = {}, &block)
  raise LocalJumpError unless block_given?

  Retry.new do |r|
    r.tries    = opts[:tries] if opts[:tries]
    r.on       = opts[:on] if opts[:on]
    r.interval = opts[:interval] if opts[:interval]
    r.timeout  = opts[:timeout] if opts[:timeout]
    r.on_retry = opts[:on_retry] if opts[:on_retry]
  end.perform(&block)
end