summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/workbook_views.rb
blob: 45d146f18e2b50e525fb32e2b507f1d1cf7c9e57 (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 BookView objects
  class WorkbookViews < SimpleTypedList
    # creates the book views object
    def initialize
      super WorkbookView
    end

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

      str << "<bookViews>"
      each { |view| view.to_xml_string(str) }
      str << '</bookViews>'
    end
  end
end