Class: Copyleaks::CopyleaksDeleteRequestModel
- Inherits:
-
Object
- Object
- Copyleaks::CopyleaksDeleteRequestModel
- Defined in:
- lib/copyleaks/models/delete_request_model.rb
Instance Attribute Summary collapse
-
#completionWebhook ⇒ Object
readonly
Returns the value of attribute completionWebhook.
-
#purge ⇒ Object
readonly
Returns the value of attribute purge.
-
#scans ⇒ Object
readonly
Returns the value of attribute scans.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(scans, purge = false, completionWebhook = '') ⇒ CopyleaksDeleteRequestModel
constructor
A new instance of CopyleaksDeleteRequestModel.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(scans, purge = false, completionWebhook = '') ⇒ CopyleaksDeleteRequestModel
Returns a new instance of CopyleaksDeleteRequestModel.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 32 def initialize(scans, purge = false, completionWebhook = '') scans.each do |object_id| unless object_id.instance_of?(IdObject) raise 'Copyleaks::CopyleaksDeleteRequestModel - scans - entity must be of type Copyleaks::IdObject' end end unless [true, false].include? purge raise 'Copyleaks::CopyleaksDeleteRequestModel - purge - purge must be of type Boolean' end unless completionWebhook.instance_of?(String) raise 'Copyleaks::CopyleaksDeleteRequestModel - completionWebhook - completionWebhook must be of type String' end @scans = scans @purge = purge @completionWebhook = completionWebhook end |
Instance Attribute Details
#completionWebhook ⇒ Object (readonly)
Returns the value of attribute completionWebhook.
27 28 29 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 27 def completionWebhook @completionWebhook end |
#purge ⇒ Object (readonly)
Returns the value of attribute purge.
27 28 29 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 27 def purge @purge end |
#scans ⇒ Object (readonly)
Returns the value of attribute scans.
27 28 29 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 27 def scans @scans end |
Instance Method Details
#as_json(*_args) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 52 def as_json(*_args) { scans: @scans.map { |object_id| object_id.as_json }, purge: @purge, completionWebhook: @completionWebhook }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
60 61 62 |
# File 'lib/copyleaks/models/delete_request_model.rb', line 60 def to_json(*) as_json(*).to_json(*) end |