Class: Copyleaks::ErrorWebhook
- Inherits:
-
StatusWebhook
- Object
- Webhook
- StatusWebhook
- Copyleaks::ErrorWebhook
- Defined in:
- lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Attributes inherited from StatusWebhook
Attributes inherited from Webhook
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(error: nil, **args) ⇒ ErrorWebhook
constructor
A new instance of ErrorWebhook.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(error: nil, **args) ⇒ ErrorWebhook
Returns a new instance of ErrorWebhook.
24 25 26 27 |
# File 'lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb', line 24 def initialize(error: nil, **args) super(**args) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb', line 22 def error @error end |
Instance Method Details
#as_json(*_args) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb', line 29 def as_json(*_args) super.merge( { error: @error.respond_to?(:as_json) ? @error.as_json : @error } ) end |
#to_json(*options) ⇒ Object
37 38 39 |
# File 'lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb', line 37 def to_json(*) as_json.to_json(*) end |