Class: Copyleaks::SubmissionPDF
- Inherits:
-
Object
- Object
- Copyleaks::SubmissionPDF
- Defined in:
- lib/copyleaks/models/submissions/properties/pdf_properties.rb
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(create, title, largeLogo, rtl, version = nil, colors = nil) ⇒ SubmissionPDF
constructor
A new instance of SubmissionPDF.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(create, title, largeLogo, rtl, version = nil, colors = nil) ⇒ SubmissionPDF
Returns a new instance of SubmissionPDF.
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, largeLogo, 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 = 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(*) as_json(*).to_json(*) end |