Class: Axlsx::SheetPr
- Inherits:
-
Object
- Object
- Axlsx::SheetPr
- Includes:
- Accessors, OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/workbook/worksheet/sheet_pr.rb
Overview
The SheetPr class manages serialization of a worksheet's sheetPr element.
Instance Attribute Summary collapse
-
#tab_color ⇒ Color
The tab color of the sheet.
-
#worksheet ⇒ Worksheet
readonly
The worksheet these properties apply to!.
Instance Method Summary collapse
-
#initialize(worksheet, options = {}) ⇒ SheetPr
constructor
Creates a new SheetPr object.
-
#outline_pr ⇒ OutlinePr
The OutlinePr for this sheet pr object.
-
#page_setup_pr ⇒ PageSetUpPr
The PageSetUpPr for this sheet pr object.
-
#to_xml_string(str = +'')) ⇒ String
Serialize the object.
Methods included from SerializedAttributes
included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Methods included from OptionsParser
Constructor Details
#initialize(worksheet, options = {}) ⇒ SheetPr
Creates a new SheetPr object
34 35 36 37 38 39 40 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 34 def initialize(worksheet, = {}) raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet) @worksheet = worksheet @outline_pr = nil end |
Instance Attribute Details
#tab_color ⇒ Color
The tab color of the sheet.
48 49 50 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 48 def tab_color @tab_color end |
#worksheet ⇒ Worksheet (readonly)
The worksheet these properties apply to!
44 45 46 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 44 def worksheet @worksheet end |
Instance Method Details
#outline_pr ⇒ OutlinePr
The OutlinePr for this sheet pr object
72 73 74 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 72 def outline_pr @outline_pr ||= OutlinePr.new end |
#page_setup_pr ⇒ PageSetUpPr
The PageSetUpPr for this sheet pr object
66 67 68 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 66 def page_setup_pr @page_setup_pr ||= PageSetUpPr.new end |
#to_xml_string(str = +'')) ⇒ String
Serialize the object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 53 def to_xml_string(str = +'') update_properties str << '<sheetPr ' serialized_attributes(str) str << '>' tab_color.to_xml_string(str, 'tabColor') if tab_color outline_pr.to_xml_string(str) if @outline_pr page_setup_pr.to_xml_string(str) str << "</sheetPr>" end |