Class: TableAnalysis::Header
- Inherits:
-
Object
- Object
- TableAnalysis::Header
- Defined in:
- lib/table_analysis/header.rb
Class Method Summary collapse
Class Method Details
.config(selected_cols, *trs) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/table_analysis/header.rb', line 3 def self.config(selected_cols, *trs) result = [] trs.flatten.each do |tr| result << Array.new(tr.length) end result = result.flatten selected_cols.each do |selected_col| result[selected_col - 1] = 1 end result.map! { |r| r.nil? ? 0 : r } end |