Class: Copyleaks::NewResultsInternet

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

Direct Known Subclasses

Internet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:, introduction:, matchedWords:, scanId:, metadata:, url:) ⇒ NewResultsInternet

Returns a new instance of NewResultsInternet.

Parameters:

  • id (String)
    • Unique result ID to identify the result.

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

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

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

  • metadata (Metadata)
    • Metadata object

  • url (String)
    • Public URL of the resource.



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

def initialize(id:, title:, introduction:, matchedWords:, scanId:, metadata:, url:)
  raise 'Copyleaks::NewResultsInternet - id must be a String' unless id.is_a?(String)
  raise 'Copyleaks::NewResultsInternet - title must be a String' unless title.is_a?(String)
  raise 'Copyleaks::NewResultsInternet - introduction must be a String' unless introduction.is_a?(String)
  raise 'Copyleaks::NewResultsInternet - matchedWords must be an Integer' unless matchedWords.is_a?(Integer)
  raise 'Copyleaks::NewResultsInternet - metadata must be a Metadata' unless .is_a?(Metadata)
  raise 'Copyleaks::NewResultsInternet - url must be a String' unless url.is_a?(String)

  @id = id
  @title = title
  @introduction = introduction
  @matchedWords = matchedWords
  @metadata = 
  @url = url
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def id
  @id
end

#introductionObject (readonly)

Returns the value of attribute introduction.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def introduction
  @introduction
end

#matchedWordsObject (readonly)

Returns the value of attribute matchedWords.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def matchedWords
  @matchedWords
end

#metadataObject (readonly)

Returns the value of attribute metadata.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def 
  @metadata
end

#titleObject (readonly)

Returns the value of attribute title.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



21
22
23
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 21

def url
  @url
end

Instance Method Details

#as_json(*_args) ⇒ Object



45
46
47
48
49
50
51
52
53
54
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 45

def as_json(*_args)
  {
    id: @id,
    title: @title,
    introduction: @introduction,
    matchedWords: @matchedWords,
    metadata: @metadata,
    url: @url
  }
end

#to_json(*options) ⇒ Object



56
57
58
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb', line 56

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