Class: SequencescapeExcel::Configuration::Columns

Inherits:
Object
  • Object
show all
Defined in:
app/sequencescape_excel/sequencescape_excel/configuration.rb

Overview

Columns

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(columns, conditional_formattings, initial_column_sets) ⇒ Columns

Returns a new instance of Columns.



60
61
62
63
64
65
66
67
68
69
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 60

def initialize(columns, conditional_formattings, initial_column_sets)
  @all = ColumnList.new(columns, conditional_formattings).freeze

  initial_column_sets.each do |key, manifest_type|
    extract = all.extract(manifest_type.columns).freeze
    instance_variable_set "@#{key}", extract
    class_eval { attr_reader key }
    column_sets[key] = extract
  end
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



58
59
60
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 58

def all
  @all
end

Instance Method Details

#==(other) ⇒ Object



75
76
77
78
79
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 75

def ==(other)
  return false unless other.is_a?(self.class)

  all == other.all
end

#find(key) ⇒ Object



71
72
73
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 71

def find(key)
  column_sets[key] || column_sets[key.to_s]
end