Class: Writexlsx::Formats

Inherits:
Object
  • Object
show all
Includes:
Utility
Defined in:
lib/write_xlsx/formats.rb

Constant Summary

Constants included from Utility

Utility::COL_MAX, Utility::ROW_MAX, Utility::SHEETNAME_MAX, Utility::STR_MAX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utility

#absolute_char, #check_dimensions, #check_dimensions_and_update_max_min_values, #check_parameter, #convert_date_time, delete_files, #float_to_str, #pixels_to_points, #ptrue?, #put_deprecate_message, #row_col_notation, #shape_style_base, #store_col_max_min_values, #store_row_max_min_values, #substitute_cellref, #underline_attributes, #v_shape_attributes_base, #v_shape_style_base, #write_anchor, #write_auto_fill, #write_color, #write_comment_path, #write_div, #write_fill, #write_font, #write_stroke, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell, #xml_str

Constructor Details

#initializeFormats

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_indicesObject (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

#formatsObject (readonly)

Returns the value of attribute formats.



8
9
10
# File 'lib/write_xlsx/formats.rb', line 8

def formats
  @formats
end

#xf_format_indicesObject (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