Class: Axlsx::TableStyleInfo
- Inherits:
-
Object
- Object
- Axlsx::TableStyleInfo
- Includes:
- Accessors, OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/workbook/worksheet/table_style_info.rb
Overview
The table style info class manages style attributes for defined tables in a worksheet
Instance Attribute Summary collapse
-
#name ⇒ Object
The name of the table style.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TableStyleInfo
constructor
creates a new TableStyleInfo instance.
-
#initialize_defaults ⇒ Object
Initialize all the values to false as Excel requires them to explicitly be disabled or all will show.
-
#to_xml_string(str = '') ⇒ Object
seralizes this object to an xml string.
Methods included from SerializedAttributes
included, #serialized_attributes, #serialized_element_attributes
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ TableStyleInfo
creates a new TableStyleInfo instance
21 22 23 24 25 |
# File 'lib/axlsx/workbook/worksheet/table_style_info.rb', line 21 def initialize( = {}) initialize_defaults @name = 'TableStyleMedium9' end |
Instance Attribute Details
#name ⇒ Object
The name of the table style.
41 42 43 |
# File 'lib/axlsx/workbook/worksheet/table_style_info.rb', line 41 def name @name end |
Instance Method Details
#initialize_defaults ⇒ Object
Initialize all the values to false as Excel requires them to explicitly be disabled or all will show.
34 35 36 37 38 |
# File 'lib/axlsx/workbook/worksheet/table_style_info.rb', line 34 def initialize_defaults %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr| self.send("#{attr}=", 0) end end |
#to_xml_string(str = '') ⇒ Object
seralizes this object to an xml string
45 46 47 48 49 |
# File 'lib/axlsx/workbook/worksheet/table_style_info.rb', line 45 def to_xml_string(str = '') str << '<tableStyleInfo ' serialized_attributes str str << '/>' end |