summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/conditional_formattings.rb
blob: ad2e9c97e418a90d5eba8a8e110760b35219349b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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