summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/outline_pr.rb
blob: 1059ad18c31b2a05192c67d2af7c4dad8b360d6f (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
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

module Axlsx
  # The OutlinePr class manages serialization of a worksheet's outlinePr element, which provides various
  # options to control outlining.
  class OutlinePr
    include Axlsx::OptionsParser
    include Axlsx::Accessors
    include Axlsx::SerializedAttributes

    serializable_attributes :summary_below,
                            :summary_right,
                            :apply_styles

    # These attributes are all boolean so I'm doing a bit of a hand
    # waving magic show to set up the attriubte accessors
    boolean_attr_accessor :summary_below,
                          :summary_right,
                          :apply_styles

    # Creates a new OutlinePr object
    # @param [Hash] options used to create the outline_pr
    def initialize(options = {})
      parse_options options
    end

    # Serialize the object
    # @param [String] str serialized output will be appended to this object if provided.
    # @return [String]
    def to_xml_string(str = +'')
      str << '<outlinePr '
      serialized_attributes(str)
      str << '/>'
    end
  end
end