class Copyleaks::Notifications
Attributes
Public Class Methods
Source
# File lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Notifications.rb, line 25 def initialize(alerts: nil) if !alerts.nil? && !(alerts.is_a?(Array) && alerts.all? { |a| a.is_a?(Alerts) }) raise 'Copyleaks::Notifications - alerts must be an array of Alerts objects' end @alerts = alerts end
@param [Array<Alerts>] alerts - A list of scan alerts that were detected in the scan.
Public Instance Methods
Source
# File lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Notifications.rb, line 33 def as_json(*_args) { alerts: @alerts }.select { |_k, v| !v.nil? } end
Source
# File lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Notifications.rb, line 39 def to_json(*options) as_json(*options).to_json(*options) end