Class: Copyleaks::ExportCompletedWebhook

Inherits:
Webhook
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb

Instance Attribute Summary collapse

Attributes inherited from Webhook

#developerPayload

Instance Method Summary collapse

Constructor Details

#initialize(completed: nil, tasks: nil, **args) ⇒ ExportCompletedWebhook

Returns a new instance of ExportCompletedWebhook.



24
25
26
27
28
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 24

def initialize(completed: nil, tasks: nil, **args)
  super(**args)
  @completed = completed
  @tasks = tasks
end

Instance Attribute Details

#completedObject (readonly)

Returns the value of attribute completed.



22
23
24
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 22

def completed
  @completed
end

#tasksObject (readonly)

Returns the value of attribute tasks.



22
23
24
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 22

def tasks
  @tasks
end

Instance Method Details

#as_json(*_args) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 30

def as_json(*_args)
  super.merge(
    {
      completed: @completed,
      tasks: @tasks.respond_to?(:map) ? @tasks.map { |t| t.respond_to?(:as_json) ? t.as_json : t } : @tasks
    }
  )
end

#to_json(*options) ⇒ Object



39
40
41
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 39

def to_json(*options)
  as_json.to_json(*options)
end