Class: Desiru::Jobs::WebhookResult

Inherits:
Object
  • Object
show all
Defined in:
lib/desiru/jobs/webhook_notifier.rb

Overview

Result of a webhook notification

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success:, status_code: nil, body: nil, headers: nil, error: nil, attempts: 1) ⇒ WebhookResult

Returns a new instance of WebhookResult.



106
107
108
109
110
111
112
113
# File 'lib/desiru/jobs/webhook_notifier.rb', line 106

def initialize(success:, status_code: nil, body: nil, headers: nil, error: nil, attempts: 1)
  @success = success
  @status_code = status_code
  @body = body
  @headers = headers
  @error = error
  @attempts = attempts
end

Instance Attribute Details

#attemptsObject (readonly)

Returns the value of attribute attempts.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def attempts
  @attempts
end

#bodyObject (readonly)

Returns the value of attribute body.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def body
  @body
end

#errorObject (readonly)

Returns the value of attribute error.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def error
  @error
end

#headersObject (readonly)

Returns the value of attribute headers.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def headers
  @headers
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def status_code
  @status_code
end

#successObject (readonly)

Returns the value of attribute success.



104
105
106
# File 'lib/desiru/jobs/webhook_notifier.rb', line 104

def success
  @success
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/desiru/jobs/webhook_notifier.rb', line 119

def failed?
  !@success
end

#success?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/desiru/jobs/webhook_notifier.rb', line 115

def success?
  @success
end