Class: Axlsx::CellStyle
- Inherits:
-
Object
- Object
- Axlsx::CellStyle
- Defined in:
- lib/axlsx/stylesheet/cell_style.rb
Overview
Using Styles#add_style is the recommended way to manage cell styling.
CellStyle defines named styles that reference defined formatting records and can be used in your worksheet.
Instance Attribute Summary collapse
-
#builtinId ⇒ Integer
The buildinId to use when this named style is applied.
-
#customBuiltin ⇒ Boolean
Indicates that the build in style reference has been customized.
-
#hidden ⇒ Boolean
Determines if this named style should show in the list of styles when using excel.
-
#iLevel ⇒ Integer
Determines if this formatting is for an outline style, and what level of the outline it is to be applied to.
-
#name ⇒ String
The name of this cell style.
-
#xfId ⇒ Integer
The formatting record id this named style utilizes.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CellStyle
constructor
Creats a new CellStyle object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(options = {}) ⇒ CellStyle
Creats a new CellStyle object
40 41 42 43 44 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 40 def initialize(={}) .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] end end |
Instance Attribute Details
#builtinId ⇒ Integer
The buildinId to use when this named style is applied
19 20 21 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 19 def builtinId @builtinId end |
#customBuiltin ⇒ Boolean
Indicates that the build in style reference has been customized.
31 32 33 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 31 def customBuiltin @customBuiltin end |
#hidden ⇒ Boolean
Determines if this named style should show in the list of styles when using excel
27 28 29 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 27 def hidden @hidden end |
#iLevel ⇒ Integer
Determines if this formatting is for an outline style, and what level of the outline it is to be applied to.
23 24 25 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 23 def iLevel @iLevel end |
#name ⇒ String
The name of this cell style
9 10 11 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 9 def name @name end |
#xfId ⇒ Integer
The formatting record id this named style utilizes
14 15 16 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 14 def xfId @xfId end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
61 62 63 64 65 |
# File 'lib/axlsx/stylesheet/cell_style.rb', line 61 def to_xml_string(str = '') str << '<cellStyle ' str << instance_values.map { |key, value| '' << key.to_s << '="' << value.to_s << '"' }.join(' ') str << '/>' end |