Module: WithRetry::Functions

Defined in:
lib/with_retry/functions.rb

Class Method Summary collapse

Class Method Details

.build_options(args = {}) ⇒ Object



3
4
5
# File 'lib/with_retry/functions.rb', line 3

def build_options(args = {})
  defaults.merge(args)
end

.defaultsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/with_retry/functions.rb', line 7

def defaults
  {
    limit: 3,
    on: StandardError,
    sleep: 0,
    failed: nil,
    before_giving_up: ->{},
    before_retrying: ->{}
  }
end