Class: Copyleaks::SharedResultsModel

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/SharedResultsModel.rb

Direct Known Subclasses

Batch, Database, NewResultsRepositories, Repositories

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, title: nil, introduction: nil, matchedWords: nil, scanId: nil, metadata: nil) ⇒ SharedResultsModel

Returns a new instance of SharedResultsModel.

Parameters:

  • $id (string)
    • Unique result ID to identify this result.

  • $introduction (string)
    • Document brief introduction. Mostly extracted from the document content.

  • $matchedWords (int)
    • Total matched words between this result and the scanned document.

  • $scanId (string|null)
    • In case a result was found in the Copyleaks internal database and was submitted by you, this will show the scan id of the specific result. Otherwise, this field will remain empty.

  • $metadata (Metadata)
    • Metadata object.

  • $title (string)
    • Document title. Mostly extracted from the document content.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/SharedResultsModel.rb', line 30

def initialize(
  id: nil,
  title: nil,
  introduction: nil,
  matchedWords: nil,
  scanId: nil,
  metadata: nil
)
  @id = id
  @title = title
  @introduction = introduction
  @matchedWords = matchedWords
  @scanId = scanId
  @metadata = 
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#introductionObject (readonly)

Returns the value of attribute introduction.



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

def introduction
  @introduction
end

#matchedWordsObject (readonly)

Returns the value of attribute matchedWords.



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

def matchedWords
  @matchedWords
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#scanIdObject (readonly)

Returns the value of attribute scanId.



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

def scanId
  @scanId
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end