Class: Copyleaks::ExportPdfReport
- Inherits:
-
Object
- Object
- Copyleaks::ExportPdfReport
- Defined in:
- lib/copyleaks/models/exports/export_pdf_report.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(endpoint, verb, headers = nil) ⇒ ExportPdfReport
constructor
A new instance of ExportPdfReport.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(endpoint, verb, headers = nil) ⇒ ExportPdfReport
Returns a new instance of ExportPdfReport.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 31 def initialize(endpoint, verb, headers = nil) unless endpoint.instance_of?(String) raise 'Copyleaks::ExportPdfReport - endpoint - endpoint must be of type String' end raise 'Copyleaks::ExportPdfReport - verb - verb must be of type String' unless verb.instance_of?(String) @endpoint = endpoint @verb = verb @headers = headers end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 26 def endpoint @endpoint end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 26 def headers @headers end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 26 def verb @verb end |
Instance Method Details
#as_json(*_args) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 42 def as_json(*_args) { endpoint: @endpoint, verb: @verb, headers: @headers }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
50 51 52 |
# File 'lib/copyleaks/models/exports/export_pdf_report.rb', line 50 def to_json(*) as_json(*).to_json(*) end |