Class: Copyleaks::SubmissionScanningCopyleaksDB

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/properties/copyleaks_db.rb

Instance Method Summary collapse

Constructor Details

#initialize(includeMySubmissions, includeOthersSubmissions) ⇒ SubmissionScanningCopyleaksDB

Returns a new instance of SubmissionScanningCopyleaksDB.

Parameters:

  • includeMySubmissions (Boolean)

    When set to true: Copyleaks will also compare against content which was uploaded by YOU to the Copyleaks internal database. If true, it will also index the scan in the Copyleaks internal database.

  • includeOthersSubmissions (Boolean)

    When set to true: Copyleaks will also compare against content which was uploaded by OTHERS to the Copyleaks internal database. If true, it will also index the scan in the Copyleaks internal database.



28
29
30
31
# File 'lib/copyleaks/models/submissions/properties/copyleaks_db.rb', line 28

def initialize(includeMySubmissions, includeOthersSubmissions)
  @includeMySubmissions = includeMySubmissions
  @includeOthersSubmissions = includeOthersSubmissions
end

Instance Method Details

#as_json(*_args) ⇒ Object



33
34
35
36
37
38
# File 'lib/copyleaks/models/submissions/properties/copyleaks_db.rb', line 33

def as_json(*_args)
  {
    includeMySubmissions: @includeMySubmissions,
    includeOthersSubmissions: @includeOthersSubmissions
  }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



40
41
42
# File 'lib/copyleaks/models/submissions/properties/copyleaks_db.rb', line 40

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