Class: Copyleaks::SubmissionPDF

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

Instance Method Summary collapse

Constructor Details

#initialize(create, title, largeLogo, rtl, version = nil, colors = nil) ⇒ SubmissionPDF

Returns a new instance of SubmissionPDF.

Parameters:

  • create (Boolean)

    Add a request to generate a customizable export of the scan report, in a pdf format. Set to true in order to generate a pdf report for this scan.

  • title (String)

    Customize the title for the PDF report.

  • largeLogo (String)

    Customize the logo image in the PDF report.

  • rtl (Boolean)

    When set to true the text in the report will be aligned from right to left.

  • verion (SubmissionPdfVersion)
    • PDF version to generate.

  • colors (SubmissionPdfColors) (defaults to: nil)
    • Customizable colors.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/copyleaks/models/submissions/properties/pdf_properties.rb', line 33

def initialize(
  create,
  title,
  ,
  rtl,
  version = nil,
  colors = nil
)

  if !colors.nil? && !colors.instance_of?(SubmissionPdfColors)
    raise 'Copyleaks::SubmissionPDF - colors - colors must be of type SubmissionPdfColors'
  end

  @create = create
  @title = title
  @largeLogo = 
  @rtl = rtl
  @version = version
  @colors = colors
end

Instance Method Details

#as_json(*_args) ⇒ Object



54
55
56
57
58
59
60
61
62
63
# File 'lib/copyleaks/models/submissions/properties/pdf_properties.rb', line 54

def as_json(*_args)
  {
    create: @create,
    title: @title,
    largeLogo: @largeLogo,
    rtl: @rtl,
    version: @version,
    colors: @colors
  }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



65
66
67
# File 'lib/copyleaks/models/submissions/properties/pdf_properties.rb', line 65

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