Class: Axlsx::SheetPr
- Inherits:
-
Object
- Object
- Axlsx::SheetPr
- Defined in:
- lib/axlsx/workbook/worksheet/sheet_pr.rb
Overview
The SheetPr class manages serialization fo a worksheet's sheetPr element.
Constant Summary collapse
- BOOLEAN_ATTRIBUTES =
These attributes are all boolean so I'm doing a bit of a hand waving magic show to set up the attriubte accessors
[:sync_horizontal, :sync_vertical, :transtion_evaluation, :transition_entry, :published, :filter_mode, :enable_format_conditions_calculation]
Instance Attribute Summary collapse
-
#code_name ⇒ String
Anchor point for worksheet's window.
-
#sync_ref ⇒ String
Specifies a stable name of the sheet, which should not change over time, and does not change from user input.
-
#worksheet ⇒ Worksheet
readonly
The worksheet these properties apply to!.
Instance Method Summary collapse
-
#initialize(worksheet, options = {}) ⇒ SheetPr
constructor
Creates a new SheetPr object.
-
#page_setup_pr ⇒ PageSetUpPr
The PageSetUpPr for this sheet pr object.
-
#to_xml_string(str = '') ⇒ String
Serialize the object.
Constructor Details
#initialize(worksheet, options = {}) ⇒ SheetPr
Creates a new SheetPr object
20 21 22 23 24 25 26 27 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 20 def initialize(worksheet, ={}) raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet) @worksheet = worksheet .each do |key, value| attr = "#{key}=" self.send(attr, value) if self.respond_to?(attr) end end |
Instance Attribute Details
#code_name ⇒ String
Anchor point for worksheet's window.
48 49 50 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 48 def code_name @code_name end |
#sync_ref ⇒ String
Specifies a stable name of the sheet, which should not change over time, and does not change from user input. This name should be used by code to reference a particular sheet.
54 55 56 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 54 def sync_ref @sync_ref end |
#worksheet ⇒ Worksheet (readonly)
The worksheet these properties apply to!
58 59 60 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 58 def worksheet @worksheet end |
Instance Method Details
#page_setup_pr ⇒ PageSetUpPr
The PageSetUpPr for this sheet pr object
84 85 86 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 84 def page_setup_pr @page_setup_pr ||= PageSetUpPr.new end |
#to_xml_string(str = '') ⇒ String
Serialize the object
75 76 77 78 79 80 |
# File 'lib/axlsx/workbook/worksheet/sheet_pr.rb', line 75 def to_xml_string(str = '') update_properties str << "<sheetPr #{serialized_attributes}>" page_setup_pr.to_xml_string(str) str << "</sheetPr>" end |