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