Class: Writexlsx::Formats
- Inherits:
-
Object
- Object
- Writexlsx::Formats
- Defined in:
- lib/write_xlsx/formats.rb
Instance Attribute Summary collapse
-
#dxf_format_indices ⇒ Object
readonly
Returns the value of attribute dxf_format_indices.
-
#formats ⇒ Object
readonly
Returns the value of attribute formats.
-
#xf_format_indices ⇒ Object
readonly
Returns the value of attribute xf_format_indices.
Instance Method Summary collapse
- #dxf_index_by_key(key) ⇒ Object
-
#initialize ⇒ Formats
constructor
A new instance of Formats.
- #set_dxf_index_by_key(key) ⇒ Object
- #set_xf_index_by_key(key) ⇒ Object
- #xf_index_by_key(key) ⇒ Object
Constructor Details
#initialize ⇒ Formats
Returns a new instance of Formats.
10 11 12 13 14 |
# File 'lib/write_xlsx/formats.rb', line 10 def initialize @formats = [] @xf_format_indices = {} @dxf_format_indices = {} end |
Instance Attribute Details
#dxf_format_indices ⇒ Object (readonly)
Returns the value of attribute dxf_format_indices.
8 9 10 |
# File 'lib/write_xlsx/formats.rb', line 8 def dxf_format_indices @dxf_format_indices end |
#formats ⇒ Object (readonly)
Returns the value of attribute formats.
8 9 10 |
# File 'lib/write_xlsx/formats.rb', line 8 def formats @formats end |
#xf_format_indices ⇒ Object (readonly)
Returns the value of attribute xf_format_indices.
8 9 10 |
# File 'lib/write_xlsx/formats.rb', line 8 def xf_format_indices @xf_format_indices end |
Instance Method Details
#dxf_index_by_key(key) ⇒ Object
24 25 26 |
# File 'lib/write_xlsx/formats.rb', line 24 def dxf_index_by_key(key) @dxf_format_indices[key] end |
#set_dxf_index_by_key(key) ⇒ Object
28 29 30 |
# File 'lib/write_xlsx/formats.rb', line 28 def set_dxf_index_by_key(key) @dxf_format_indices[key] ||= @dxf_format_indices.size end |
#set_xf_index_by_key(key) ⇒ Object
20 21 22 |
# File 'lib/write_xlsx/formats.rb', line 20 def set_xf_index_by_key(key) @xf_format_indices[key] ||= 1 + @xf_format_indices.size end |
#xf_index_by_key(key) ⇒ Object
16 17 18 |
# File 'lib/write_xlsx/formats.rb', line 16 def xf_index_by_key(key) @xf_format_indices[key] end |