Module: SequencescapeExcel::Helpers::Worksheet

Overview

Add the basic styles which are the same across all worksheets.

Defined Under Namespace

Classes: Style

Constant Summary collapse

STYLES =
{ unlocked: { locked: false, border: { style: :thin, color: '00' } },
                 unlocked_no_border: { locked: false },
                 wrap_text: { alignment: { horizontal: :center, vertical: :center, wrap_text: true },
border: { style: :thin, color: '00', edges: %i[left right top bottom] } } }.freeze

Instance Method Summary collapse

Instance Method Details

#add_headersObject


13
14
15
# File 'app/sequencescape_excel/sequencescape_excel/helpers/worksheet.rb', line 13

def add_headers
  add_row columns.headings, styles[:wrap_text].reference
end

#create_stylesObject


26
27
28
29
30
31
32
# File 'app/sequencescape_excel/sequencescape_excel/helpers/worksheet.rb', line 26

def create_styles
  styles.tap do |s|
    STYLES.each do |k, style|
      s[k] = Style.new(workbook, style)
    end
  end
end

#first_rowObject

The row where the table with data starts (after headings)


18
19
20
# File 'app/sequencescape_excel/sequencescape_excel/helpers/worksheet.rb', line 18

def first_row
  10
end

#stylesObject


22
23
24
# File 'app/sequencescape_excel/sequencescape_excel/helpers/worksheet.rb', line 22

def styles
  @styles ||= {}
end