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' } },
                 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


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

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

#create_stylesObject


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

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)


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

def first_row
  10
end

#stylesObject


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

def styles
  @styles ||= {}
end