Class: HookSniff::Models::RetryPolicy
- Inherits:
-
Object
- Object
- HookSniff::Models::RetryPolicy
- Defined in:
- lib/hooksniff/models.rb
Instance Attribute Summary collapse
-
#backoff ⇒ Object
readonly
Returns the value of attribute backoff.
-
#initial_delay_secs ⇒ Object
readonly
Returns the value of attribute initial_delay_secs.
-
#max_attempts ⇒ Object
readonly
Returns the value of attribute max_attempts.
-
#max_delay_secs ⇒ Object
readonly
Returns the value of attribute max_delay_secs.
Instance Method Summary collapse
-
#initialize(data) ⇒ RetryPolicy
constructor
A new instance of RetryPolicy.
- #to_h ⇒ Object
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
#backoff ⇒ Object (readonly)
Returns the value of attribute backoff.
30 31 32 |
# File 'lib/hooksniff/models.rb', line 30 def backoff @backoff end |
#initial_delay_secs ⇒ Object (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_attempts ⇒ Object (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_secs ⇒ Object (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_h ⇒ Object
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 |