Class: Quote::CombinedPdfGenerator::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/quote/combined_pdf_generator.rb

Overview

Service object: result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf_data: nil, pdf_file_path: nil, copy_of_plans_pdf_file_path: nil, copy_of_plans_file_name: nil, file_name: nil, quote: nil, options: nil, additional_attachments: nil) ⇒ Result

Returns a new instance of Result.

Parameters:

  • pdf_data (String, nil) (defaults to: nil)

    the compressed PDF blob when streaming

  • pdf_file_path (String, nil) (defaults to: nil)

    path to the compressed PDF file when output_to_file is set

  • copy_of_plans_pdf_file_path (String, nil) (defaults to: nil)

    path to the separate copy-of-plans PDF, if any

  • copy_of_plans_file_name (String, nil) (defaults to: nil)

    file name of the copy-of-plans PDF, if any

  • file_name (String, nil) (defaults to: nil)

    suggested file name for the combined PDF

  • quote (Quote, nil) (defaults to: nil)

    the quote the PDF was generated for

  • additional_attachments (Array<Integer>, nil) (defaults to: nil)

    ids of publications attached to the PDF

  • options (Hash, nil) (defaults to: nil)

    the generation options that were used (see Quote::CombinedPdfGenerator#process)

Options Hash (options:):

  • output_to_file (Boolean)

    whether the PDF was written to a file



16
# File 'app/services/quote/combined_pdf_generator.rb', line 16

def initialize(pdf_data: nil, pdf_file_path: nil, copy_of_plans_pdf_file_path: nil, copy_of_plans_file_name: nil, file_name: nil, quote: nil, options: nil, additional_attachments: nil) = super

Instance Attribute Details

#additional_attachmentsObject (readonly)

Returns the value of attribute additional_attachments

Returns:

  • (Object)

    the current value of additional_attachments



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def additional_attachments
  @additional_attachments
end

#copy_of_plans_file_nameObject (readonly)

Returns the value of attribute copy_of_plans_file_name

Returns:

  • (Object)

    the current value of copy_of_plans_file_name



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def copy_of_plans_file_name
  @copy_of_plans_file_name
end

#copy_of_plans_pdf_file_pathObject (readonly)

Returns the value of attribute copy_of_plans_pdf_file_path

Returns:

  • (Object)

    the current value of copy_of_plans_pdf_file_path



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def copy_of_plans_pdf_file_path
  @copy_of_plans_pdf_file_path
end

#file_nameObject (readonly)

Returns the value of attribute file_name

Returns:

  • (Object)

    the current value of file_name



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def file_name
  @file_name
end

#optionsObject (readonly)

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def options
  @options
end

#pdf_dataObject (readonly)

Returns the value of attribute pdf_data

Returns:

  • (Object)

    the current value of pdf_data



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def pdf_data
  @pdf_data
end

#pdf_file_pathObject (readonly)

Returns the value of attribute pdf_file_path

Returns:

  • (Object)

    the current value of pdf_file_path



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def pdf_file_path
  @pdf_file_path
end

#quoteObject (readonly)

Returns the value of attribute quote

Returns:

  • (Object)

    the current value of quote



6
7
8
# File 'app/services/quote/combined_pdf_generator.rb', line 6

def quote
  @quote
end