summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/defined_names.rb
blob: e59acf4b1db2b9794e5425ef1d0f7901b7c234f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Axlsx
  # a simple types list of DefinedName objects
  class DefinedNames < SimpleTypedList
    # creates the DefinedNames object
    def initialize
      super DefinedName
    end

    # Serialize to xml
    # @param [String] str
    # @return [String]
    def to_xml_string(str = +'')
      return if empty?

      str << '<definedNames>'
      each { |defined_name| defined_name.to_xml_string(str) }
      str << '</definedNames>'
    end
  end
end