Class: Axlsx::TableStyle
- Inherits:
-
SimpleTypedList
- Object
- SimpleTypedList
- Axlsx::TableStyle
- Includes:
- OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/stylesheet/table_style.rb
Overview
Note:
Table are not supported in this version and only the defaults required for a valid workbook are created.
A single table style definition and is a collection for tableStyleElements
Instance Attribute Summary collapse
-
#name ⇒ string
The name of this table style.
-
#pivot ⇒ Boolean
indicates if this style should be applied to pivot tables.
-
#table ⇒ Boolean
indicates if this style should be applied to tables.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ TableStyle
constructor
creates a new TableStyle object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Methods included from SerializedAttributes
#declared_attributes, included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Methods included from OptionsParser
Constructor Details
#initialize(name, options = {}) ⇒ TableStyle
creates a new TableStyle object
13 14 15 16 17 |
# File 'lib/axlsx/stylesheet/table_style.rb', line 13 def initialize(name, = {}) self.name = name super TableStyleElement end |
Instance Attribute Details
#name ⇒ string
The name of this table style
23 24 25 |
# File 'lib/axlsx/stylesheet/table_style.rb', line 23 def name @name end |
#pivot ⇒ Boolean
indicates if this style should be applied to pivot tables
27 28 29 |
# File 'lib/axlsx/stylesheet/table_style.rb', line 27 def pivot @pivot end |
#table ⇒ Boolean
indicates if this style should be applied to tables
31 32 33 |
# File 'lib/axlsx/stylesheet/table_style.rb', line 31 def table @table end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
43 44 45 46 47 48 49 |
# File 'lib/axlsx/stylesheet/table_style.rb', line 43 def to_xml_string(str = '') str << '<tableStyle ' serialized_attributes str, { :count => self.size } str << '>' each { |table_style_el| table_style_el.to_xml_string(str) } str << '</tableStyle>' end |