Class: Copyleaks::SubmissionPdfColors

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/properties/pdf_colors.rb

Instance Method Summary collapse

Constructor Details

#initialize(mainStrip = nil, title = nil, identical = nil, minorChanges = nil, relatedMeaning = nil) ⇒ SubmissionPdfColors

Returns a new instance of SubmissionPdfColors.

Parameters:

  • mainStrip (String) (defaults to: nil)
    • The color of the main strip in the header.

  • title (String) (defaults to: nil)
    • The color for titles in copyleaks result report.

  • identical (String) (defaults to: nil)
    • The highlight color for identical matches.

  • minorChanges (String) (defaults to: nil)
    • The highlight color for minor changes matches.

  • relatedMeaning (String) (defaults to: nil)
    • The highlight color for related meaning matches.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/copyleaks/models/submissions/properties/pdf_colors.rb', line 32

def initialize(
    mainStrip = nil,
    title = nil,
    identical = nil,
    minorChanges = nil,
    relatedMeaning = nil
)
    @mainStrip = mainStrip
    @title = title
    @identical = identical
    @minorChanges = minorChanges
    @relatedMeaning = relatedMeaning
end

Instance Method Details

#as_json(*_args) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/copyleaks/models/submissions/properties/pdf_colors.rb', line 46

def as_json(*_args)
    {
        mainStrip: @mainStrip,
        title: @title,
        identical: @identical,
        minorChanges: @minorChanges,
        relatedMeaning: @relatedMeaning
    }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



56
57
58
# File 'lib/copyleaks/models/submissions/properties/pdf_colors.rb', line 56

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