Sha256: d4495570b43a50f7329c4cc1c8918e65e1a404fca4288f5bd2c29a584818028e

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 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

1 entries across 1 versions & 1 rubygems

Version Path
caxlsx-4.0.0 lib/axlsx/workbook/worksheet/data_validations.rb