class ExcelSerializer::Adapters::WriteExcel

Public Class Methods

file_extension() click to toggle source
# File lib/excel_serializer/adapters/write_excel.rb, line 20
def self.file_extension
  '.xls'
end
new(file_path) click to toggle source

 This is the adapter for WriteExcel gem

# File lib/excel_serializer/adapters/write_excel.rb, line 6
def initialize(file_path)
  @write_excel = ::WriteExcel.new(file_path)
rescue NameError => e
  raise ExcelAdapterNotFoundError.new('WriteExcel', 'writeexcel')
end

Public Instance Methods

add_worksheet(sheet_name) click to toggle source
# File lib/excel_serializer/adapters/write_excel.rb, line 12
def add_worksheet(sheet_name)
  WorkSheet.new(@write_excel, sheet_name)
end
save() click to toggle source
# File lib/excel_serializer/adapters/write_excel.rb, line 16
def save
  @write_excel.close
end