Class: SequencescapeExcel::Configuration
- Inherits:
-
Object
- Object
- SequencescapeExcel::Configuration
- Includes:
- Helpers
- Defined in:
- app/sequencescape_excel/sequencescape_excel/configuration.rb
Overview
Configuration class for sample manifests handling fornatting, manifest types, ranges and columns.
Direct Known Subclasses
BulkSubmissionExcel::Configuration, SampleManifestExcel::Configuration
Defined Under Namespace
Classes: Columns
Constant Summary collapse
- FILES =
%i[conditional_formattings ranges columns].freeze
Instance Attribute Summary collapse
-
#column_sets ⇒ Object
Returns the value of attribute column_sets.
-
#folder ⇒ Object
Returns the value of attribute folder.
-
#tag_group ⇒ Object
Returns the value of attribute tag_group.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add_file(file) ⇒ Object
- #columns=(columns) ⇒ Object
- #conditional_formattings=(conditional_formattings) ⇒ Object
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
- #load! ⇒ Object
- #loaded? ⇒ Boolean
- #ranges=(ranges) ⇒ Object
Methods included from Helpers
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 15 def initialize @files = self.class::FILES.dup yield self if block_given? end |
Instance Attribute Details
#column_sets ⇒ Object
Returns the value of attribute column_sets.
12 13 14 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 12 def column_sets @column_sets end |
#folder ⇒ Object
Returns the value of attribute folder.
12 13 14 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 12 def folder @folder end |
#tag_group ⇒ Object
Returns the value of attribute tag_group.
12 13 14 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 12 def tag_group @tag_group end |
Instance Method Details
#==(other) ⇒ Object
48 49 50 51 52 53 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 48 def ==(other) return false unless other.is_a?(self.class) folder == other.folder && conditional_formattings == other.conditional_formattings && ranges == other.ranges && columns == other.columns end |
#add_file(file) ⇒ Object
20 21 22 23 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 20 def add_file(file) @files << file.to_sym class_eval { attr_accessor file.to_sym } end |
#columns=(columns) ⇒ Object
36 37 38 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 36 def columns=(columns) @columns = Columns.new(columns, conditional_formattings, column_sets).freeze end |
#conditional_formattings=(conditional_formattings) ⇒ Object
32 33 34 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 32 def conditional_formattings=(conditional_formattings) @conditional_formattings = ConditionalFormattingDefaultList.new(conditional_formattings).freeze end |
#load! ⇒ Object
25 26 27 28 29 30 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 25 def load! return if folder.blank? @files.each { |file| send("#{file}=", load_file(folder, file.to_s)) } @loaded = true end |
#loaded? ⇒ Boolean
44 45 46 |
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 44 def loaded? loaded end |