Class: Copyleaks::ScannedDocument
- Inherits:
-
Object
- Object
- Copyleaks::ScannedDocument
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb
Instance Attribute Summary collapse
-
#creationTime ⇒ Object
readonly
Returns the value of attribute creationTime.
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#scanId ⇒ Object
readonly
Returns the value of attribute scanId.
-
#totalExcluded ⇒ Object
readonly
Returns the value of attribute totalExcluded.
-
#totalWords ⇒ Object
readonly
Returns the value of attribute totalWords.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(scanId:, totalWords:, totalExcluded:, credits:, creationTime:, metadata:) ⇒ ScannedDocument
constructor
A new instance of ScannedDocument.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(scanId:, totalWords:, totalExcluded:, credits:, creationTime:, metadata:) ⇒ ScannedDocument
Returns a new instance of ScannedDocument.
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?(Metadata) @scanId = scanId @totalWords = totalWords @totalExcluded = totalExcluded @credits = credits @creationTime = creationTime = end |
Instance Attribute Details
#creationTime ⇒ Object (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 |
#credits ⇒ Object (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 |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb', line 22 def end |
#scanId ⇒ Object (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 |
#totalExcluded ⇒ Object (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 |
#totalWords ⇒ Object (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(*) as_json(*).to_json(*) end |