Class: Copyleaks::ExportCompletedWebhook
- Defined in:
- lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb
Instance Attribute Summary collapse
-
#completed ⇒ Object
readonly
Returns the value of attribute completed.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Attributes inherited from Webhook
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(completed: nil, tasks: nil, **args) ⇒ ExportCompletedWebhook
constructor
A new instance of ExportCompletedWebhook.
- #to_json(*options) ⇒ Object
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
#completed ⇒ Object (readonly)
Returns the value of attribute completed.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb', line 22 def completed @completed end |
#tasks ⇒ Object (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(*) as_json.to_json(*) end |