module AxlsxEnhanced::Helpers::Injections::Workbook

Public Instance Methods

smart_add_worksheet(options) { |worksheet| ... } click to toggle source
# File lib/axlsx_enhanced/helpers/injections/workbook.rb, line 5
def smart_add_worksheet(options)
  # Create the worksheet
  worksheet = self.add_worksheet(options)
  
  # Assign smart styles if any is given, and clean options hash
  worksheet.smart_styles = options[:smart_styles] || AxlsxEnhanced::Helpers::Styles.defaults
  options.delete(:smart_styles)
      
  # Perform a block yield if necessary
  yield worksheet if block_given?
  worksheet
end