Sha256: 4a87d241ff7b80fd96bcf1319b8dabf606b7ef5399185251136bc5d7cf9471fb

Contents?: true

Size: 671 Bytes

Versions: 4

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

module Axlsx
  # A simple, self serializing class for storing conditional formattings
  class ConditionalFormattings < SimpleTypedList
    # creates a new Tables object
    def initialize(worksheet)
      raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet)

      super(ConditionalFormatting)
      @worksheet = worksheet
    end

    # The worksheet that owns this collection of tables
    # @return [Worksheet]
    attr_reader :worksheet

    # serialize the conditional formattings
    def to_xml_string(str = +'')
      return if empty?

      each { |item| item.to_xml_string(str) }
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/conditional_formattings.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/conditional_formattings.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/conditional_formattings.rb
caxlsx-4.1.0 lib/axlsx/workbook/worksheet/conditional_formattings.rb