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


64
65
66
67
68
69
70
71
72
73
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 64

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


62
63
64
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 62

def all
  @all
end

Instance Method Details

#==(other) ⇒ Object


79
80
81
82
83
# File 'app/sequencescape_excel/sequencescape_excel/configuration.rb', line 79

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

  all == other.all
end

#find(key) ⇒ Object


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

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