class HTOTConv::Generator::XlsxBase

Public Class Methods

option_help() click to toggle source
Calls superclass method HTOTConv::Generator::Base::option_help
# File lib/htot_conv/generator/base.rb, line 23
def self.option_help
  super.merge({
    :shironuri => {
      :default => false,
      :pat => FalseClass,
      :desc => "Fill all the cells with white color (default: no)",
    },
  })
end

Public Instance Methods

output(outputfile) click to toggle source
# File lib/htot_conv/generator/base.rb, line 37
def output(outputfile)
  wb = RubyXL::Workbook.new
  shironuri(wb, wb[0]) if @option[:shironuri]
  output_to_worksheet(wb[0])
  wb.write(outputfile)
end
output_to_worksheet(ws) click to toggle source
# File lib/htot_conv/generator/base.rb, line 33
def output_to_worksheet(ws)
  raise NotImplementedError.new("#{self.class.name}.#{__method__} is an abstract method.")
end

Private Instance Methods

shironuri(wb, ws) click to toggle source
# File lib/htot_conv/generator/base.rb, line 45
def shironuri(wb, ws)
  style_index = wb.modify_fill(nil, "ffffff")
  ws.cols << RubyXL::ColumnRange.new(
    :min => 1,
    :max => 0x4000,
    :style_index => style_index,
    :width => RubyXL::ColumnRange::DEFAULT_WIDTH,
  )
end