Class: Copyleaks::ScannedDocument

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scanId:, totalWords:, totalExcluded:, credits:, creationTime:, metadata:) ⇒ ScannedDocument

Returns a new instance of ScannedDocument.

Parameters:

  • scanId (String)
    • The unique scan id provided by you.

  • totalWords (Integer)
    • Total number of words found in the scanned text.

  • totalExcluded (Integer)
    • Number of excluded words in the submitted content.

  • credits (Integer)
    • Overall credits used for the scan.

  • creationTime (String)
    • The creation time of the scan.

  • metadata (Metadata)
    • Metadata object



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

def initialize(scanId:, totalWords:, totalExcluded:, credits:, creationTime:, metadata:)
  raise 'scanId must be a String' unless scanId.is_a?(String)
  raise 'totalWords must be an Integer' unless totalWords.is_a?(Integer)
  raise 'totalExcluded must be an Integer' unless totalExcluded.is_a?(Integer)
  raise 'credits must be an Integer' unless credits.is_a?(Integer)
  raise 'creationTime must be a String' unless creationTime.is_a?(String)
  raise 'metadata must be a Metadata object' unless .is_a?()

  @scanId = scanId
  @totalWords = totalWords
  @totalExcluded = totalExcluded
  @credits = credits
  @creationTime = creationTime
   = 
end

Instance Attribute Details

#creationTimeObject (readonly)

Returns the value of attribute creationTime.



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

def creationTime
  @creationTime
end

#creditsObject (readonly)

Returns the value of attribute credits.



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

def credits
  @credits
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  
end

#scanIdObject (readonly)

Returns the value of attribute scanId.



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

def scanId
  @scanId
end

#totalExcludedObject (readonly)

Returns the value of attribute totalExcluded.



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

def totalExcluded
  @totalExcluded
end

#totalWordsObject (readonly)

Returns the value of attribute totalWords.



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

def totalWords
  @totalWords
end

Instance Method Details

#as_json(*_args) ⇒ Object



46
47
48
49
50
51
52
53
54
55
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb', line 46

def as_json(*_args)
  {
    scanId: @scanId,
    totalWords: @totalWords,
    totalExcluded: @totalExcluded,
    credits: @credits,
    creationTime: @creationTime,
    metadata: 
  }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



57
58
59
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb', line 57

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