Sha256: 7d6c582929f1abbebb7bb9ea8e52ca7ef716376f8634232b421b1bd3332785dc

Contents?: true

Size: 740 Bytes

Versions: 4

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

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

      super(DataValidation)
      @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?

      str << "<dataValidations count='#{size}'>"
      each { |item| item.to_xml_string(str) }
      str << '</dataValidations>'
    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/data_validations.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/data_validations.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/data_validations.rb
caxlsx-4.1.0 lib/axlsx/workbook/worksheet/data_validations.rb