Class: Copyleaks::StatusWebhook

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

Instance Attribute Summary collapse

Attributes inherited from Webhook

#developerPayload

Instance Method Summary collapse

Constructor Details

#initialize(status:, **args) ⇒ StatusWebhook

Returns a new instance of StatusWebhook.



24
25
26
27
28
29
30
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/StatusWebhook.rb', line 24

def initialize(status:, **args)
  unless status.is_a?(Integer)
    raise 'Copyleaks::StatusWebhook - status must be an Integer'
  end
  super(**args)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Parameters:

  • status (Integer)
    • The current status of the scan.



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

def status
  @status
end

Instance Method Details

#as_json(*_args) ⇒ Object



32
33
34
35
36
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/StatusWebhook.rb', line 32

def as_json(*_args)
  {
    status: @status
  }.merge(super)
end

#to_json(*options) ⇒ Object



38
39
40
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/StatusWebhook.rb', line 38

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