Class: Copyleaks::SubmissionIndexingRepository
- Inherits:
-
SubmissionRepository
- Object
- SubmissionRepository
- Copyleaks::SubmissionIndexingRepository
- Defined in:
- lib/copyleaks/models/submissions/properties/indexing_repository.rb
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(id, maskingPolicy = nil) ⇒ SubmissionIndexingRepository
constructor
A new instance of SubmissionIndexingRepository.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(id, maskingPolicy = nil) ⇒ SubmissionIndexingRepository
Returns a new instance of SubmissionIndexingRepository.
31 32 33 34 35 36 37 |
# File 'lib/copyleaks/models/submissions/properties/indexing_repository.rb', line 31 def initialize(id, maskingPolicy = nil) super(id) if !maskingPolicy.nil? && ![0, 1, 2].include?(maskingPolicy) raise 'Copyleaks::SubmissionIndexingRepository - maskingPolicy - maskingPolicy must be of type SubmissionMaskingPolicy' end @maskingPolicy = maskingPolicy end |
Instance Method Details
#as_json(*_args) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/copyleaks/models/submissions/properties/indexing_repository.rb', line 39 def as_json(*_args) { id: @id, maskingPolicy: @maskingPolicy, }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
46 47 48 |
# File 'lib/copyleaks/models/submissions/properties/indexing_repository.rb', line 46 def to_json(*) as_json(*).to_json(*) end |