Class: CSVPlusPlus::Writer::RubyXLModifier

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/csv_plus_plus/writer/rubyxl_modifier.rb

Overview

Build a RubyXL-decorated Modifier class adds some support for Excel

Instance Method Summary collapse

Instance Method Details

#border_weightInteger

The excel-specific border weight

Returns:

  • (Integer)


37
38
39
40
41
42
43
# File 'lib/csv_plus_plus/writer/rubyxl_modifier.rb', line 37

def border_weight
  return unless borderstyle

  # rubocop:disable Lint/ConstantResolution
  BORDER_STYLES[borderstyle.to_sym]
  # rubocop:enable Lint/ConstantResolution
end

#number_format_codeString

The excel-specific number format code

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
# File 'lib/csv_plus_plus/writer/rubyxl_modifier.rb', line 48

def number_format_code
  return unless numberformat

  ::RubyXL::NumberFormats::DEFAULT_NUMBER_FORMATS.find_by_format_id(
    # rubocop:disable Lint/ConstantResolution
    NUM_FMT_IDS[numberformat.to_sym]
    # rubocop:enable Lint/ConstantResolution
  ).format_code
end