Class: Writexlsx::Worksheet::CellData

Inherits:
Object
  • Object
show all
Includes:
Utility::CellReference, Utility::Common
Defined in:
lib/write_xlsx/worksheet/cell_data.rb

Overview

:nodoc:

Constant Summary

Constants included from Constants

Constants::COL_MAX, Constants::ROW_MAX, Constants::SHEETNAME_MAX, Constants::STR_MAX

Constants included from Utility::Common

Utility::Common::PERL_TRUE_VALUES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utility::CellReference

#row_col_notation, #substitute_cellref, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell

Methods included from Utility::Common

#absolute_char, #check_parameter, #float_to_str, #ptrue?, #put_deprecate_message

Instance Attribute Details

#xfObject (readonly)

Returns the value of attribute xf.



13
14
15
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 13

def xf
  @xf
end

Instance Method Details

#cell_attributes(worksheet, row, row_name, col) ⇒ Object

attributes for the element. This is the innermost loop so efficiency is important where possible.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 19

def cell_attributes(worksheet, row, row_name, col) # :nodoc:
  xf_index = xf ? xf.get_xf_index : 0
  attributes = [
    ['r', xl_rowcol_to_cell(row_name, col)]
  ]

  # Add the cell format index.
  if xf_index != 0
    attributes << ['s', xf_index]
  elsif worksheet.set_rows[row] && worksheet.set_rows[row][1]
    row_xf = worksheet.set_rows[row][1]
    attributes << ['s', row_xf.get_xf_index]
  elsif worksheet.col_info[col] && worksheet.col_info[col].format
    col_xf = worksheet.col_info[col].format
    attributes << ['s', col_xf.get_xf_index]
  end
  attributes
end

#display_url_string?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 38

def display_url_string?
  true
end