blob: a8c2a5b371bb838fe33d65929ec92c7d594301e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# 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
|