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