Class: Copyleaks::SubmissionScanningRepository

Inherits:
SubmissionRepository show all
Defined in:
lib/copyleaks/models/submissions/properties/scanning_repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, includeMySubmissions, includeOthersSubmissions) ⇒ SubmissionScanningRepository

Returns a new instance of SubmissionScanningRepository.

Parameters:

  • ID (String)

    of a repository to add the scanned document to.

  • includeMySubmissions (Boolean)

    Compare the scanned document against MY submissions in the repository.

  • includeOthersSubmissions (Boolean)

    Compare the scanned document against OTHER users submissions in the repository.



29
30
31
32
33
# File 'lib/copyleaks/models/submissions/properties/scanning_repository.rb', line 29

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

Instance Method Details

#as_json(*_args) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/copyleaks/models/submissions/properties/scanning_repository.rb', line 35

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

#to_json(*options) ⇒ Object



43
44
45
# File 'lib/copyleaks/models/submissions/properties/scanning_repository.rb', line 43

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