Class: Synthra::WebhookSimulator::WebhookResult
- Inherits:
-
Object
- Object
- Synthra::WebhookSimulator::WebhookResult
- Defined in:
- lib/synthra/webhook_simulator.rb
Overview
Webhook delivery result
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(success:, status:, body: nil, error: nil, payload: nil, message: nil) ⇒ WebhookResult
constructor
A new instance of WebhookResult.
- #success? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(success:, status:, body: nil, error: nil, payload: nil, message: nil) ⇒ WebhookResult
Returns a new instance of WebhookResult.
240 241 242 243 244 245 246 247 |
# File 'lib/synthra/webhook_simulator.rb', line 240 def initialize(success:, status:, body: nil, error: nil, payload: nil, message: nil) @success = success @status = status @body = body @error = error @payload = payload @message = end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
238 239 240 |
# File 'lib/synthra/webhook_simulator.rb', line 238 def body @body end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
238 239 240 |
# File 'lib/synthra/webhook_simulator.rb', line 238 def error @error end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
238 239 240 |
# File 'lib/synthra/webhook_simulator.rb', line 238 def payload @payload end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
238 239 240 |
# File 'lib/synthra/webhook_simulator.rb', line 238 def status @status end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
238 239 240 |
# File 'lib/synthra/webhook_simulator.rb', line 238 def success @success end |
Instance Method Details
#failed? ⇒ Boolean
253 254 255 |
# File 'lib/synthra/webhook_simulator.rb', line 253 def failed? !@success end |
#success? ⇒ Boolean
249 250 251 |
# File 'lib/synthra/webhook_simulator.rb', line 249 def success? @success end |
#to_h ⇒ Object
257 258 259 260 261 262 263 264 |
# File 'lib/synthra/webhook_simulator.rb', line 257 def to_h { success: @success, status: @status, body: @body, error: @error } end |