class Copyleaks::CompletedWebhook
Attributes
Public Class Methods
Source
# 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
Calls superclass method
Public Instance Methods
Source
# 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
Calls superclass method
Source
# File lib/copyleaks/models/submissions/webhooks/CompletedWebhook.rb, line 42 def to_json(*options) as_json.to_json(*options) end