Sha256: b31cf7ef0bfc22b1b0ed1d33392e71dbd7d97109b4d0eb1093ad4f38cd29e15c

Contents?: true

Size: 707 Bytes

Versions: 2

Compression:

Stored size: 707 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

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