Class: TempmailSdk::Retry::AttemptsResult

Inherits:
Object
  • Object
show all
Defined in:
lib/tempmail_sdk/retry.rb

Overview

with_retry_with_attempts 的返回值封装

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ok:, attempts:, value: nil, error: nil) ⇒ AttemptsResult

Returns a new instance of AttemptsResult.



11
12
13
14
15
16
# File 'lib/tempmail_sdk/retry.rb', line 11

def initialize(ok:, attempts:, value: nil, error: nil)
  @ok = ok
  @attempts = attempts
  @value = value
  @error = error
end

Instance Attribute Details

#attemptsObject (readonly)

Returns the value of attribute attempts.



9
10
11
# File 'lib/tempmail_sdk/retry.rb', line 9

def attempts
  @attempts
end

#errorObject (readonly)

Returns the value of attribute error.



9
10
11
# File 'lib/tempmail_sdk/retry.rb', line 9

def error
  @error
end

#okObject (readonly)

Returns the value of attribute ok.



9
10
11
# File 'lib/tempmail_sdk/retry.rb', line 9

def ok
  @ok
end

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/tempmail_sdk/retry.rb', line 9

def value
  @value
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/tempmail_sdk/retry.rb', line 18

def ok?
  @ok
end