Class: BulkSubmissionExcel::Download
- Inherits:
-
Object
- Object
- BulkSubmissionExcel::Download
- Includes:
- ActiveModel::Model, SequencescapeExcel::Helpers::Download
- Defined in:
- app/bulk_submission_excel/bulk_submission_excel/download.rb
Overview
Download
Instance Attribute Summary collapse
-
#assets ⇒ Object
Returns the value of attribute assets.
-
#column_list ⇒ Object
Returns the value of attribute column_list.
-
#defaults ⇒ Object
Returns the value of attribute defaults.
-
#range_list ⇒ Object
Returns the value of attribute range_list.
-
#submission_template ⇒ Object
Returns the value of attribute submission_template.
Instance Method Summary collapse
- #data_worksheet ⇒ Object
-
#initialize(*args) ⇒ Download
constructor
A new instance of Download.
- #inspect ⇒ Object
- #new_record? ⇒ Boolean
- #ranges_worksheet ⇒ Object
- #submission_template_id ⇒ Object
- #submission_template_id=(id) ⇒ Object
Methods included from SequencescapeExcel::Helpers::Download
Constructor Details
#initialize(*args) ⇒ Download
Returns a new instance of Download.
14 15 16 17 18 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 14 def initialize(*args) super ranges_worksheet data_worksheet end |
Instance Attribute Details
#assets ⇒ Object
Returns the value of attribute assets.
12 13 14 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 12 def assets @assets end |
#column_list ⇒ Object
Returns the value of attribute column_list.
12 13 14 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 12 def column_list @column_list end |
#defaults ⇒ Object
Returns the value of attribute defaults.
12 13 14 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 12 def defaults @defaults end |
#range_list ⇒ Object
Returns the value of attribute range_list.
12 13 14 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 12 def range_list @range_list end |
#submission_template ⇒ Object
Returns the value of attribute submission_template.
12 13 14 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 12 def submission_template @submission_template end |
Instance Method Details
#data_worksheet ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 37 def data_worksheet return nil unless valid? @data_worksheet ||= BulkSubmissionExcel::Worksheet::DataWorksheet.new( workbook: workbook, columns: column_list, assets: assets, ranges: range_list, defaults: defaults ) end |
#inspect ⇒ Object
50 51 52 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 50 def inspect "<#{self.class}: @submission_template=#{@submission_template}, @assets=#{@assets} ...>" end |
#new_record? ⇒ Boolean
20 21 22 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 20 def new_record? true end |
#ranges_worksheet ⇒ Object
24 25 26 27 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 24 def ranges_worksheet @ranges_worksheet ||= SequencescapeExcel::Worksheet::RangesWorksheet.new(ranges: range_list, workbook: workbook) if valid? end |
#submission_template_id ⇒ Object
33 34 35 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 33 def submission_template_id submission_template&.id end |
#submission_template_id=(id) ⇒ Object
29 30 31 |
# File 'app/bulk_submission_excel/bulk_submission_excel/download.rb', line 29 def submission_template_id=(id) self.submission_template = SubmissionTemplate.find_by(id:) end |