Class: HookSniff::Models::RetryPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ RetryPolicy

Returns a new instance of RetryPolicy.



32
33
34
35
36
37
# File 'lib/hooksniff/models.rb', line 32

def initialize(data)
  @max_attempts = data["max_attempts"]
  @backoff = data["backoff"]
  @initial_delay_secs = data["initial_delay_secs"]
  @max_delay_secs = data["max_delay_secs"]
end

Instance Attribute Details

#backoffObject (readonly)

Returns the value of attribute backoff.



30
31
32
# File 'lib/hooksniff/models.rb', line 30

def backoff
  @backoff
end

#initial_delay_secsObject (readonly)

Returns the value of attribute initial_delay_secs.



30
31
32
# File 'lib/hooksniff/models.rb', line 30

def initial_delay_secs
  @initial_delay_secs
end

#max_attemptsObject (readonly)

Returns the value of attribute max_attempts.



30
31
32
# File 'lib/hooksniff/models.rb', line 30

def max_attempts
  @max_attempts
end

#max_delay_secsObject (readonly)

Returns the value of attribute max_delay_secs.



30
31
32
# File 'lib/hooksniff/models.rb', line 30

def max_delay_secs
  @max_delay_secs
end

Instance Method Details

#to_hObject



39
40
41
42
43
44
45
46
# File 'lib/hooksniff/models.rb', line 39

def to_h
  {
    max_attempts: @max_attempts,
    backoff: @backoff,
    initial_delay_secs: @initial_delay_secs,
    max_delay_secs: @max_delay_secs
  }.compact
end