Class: Writexlsx::Worksheet::StringCellData
- Defined in:
- lib/write_xlsx/worksheet/cell_data.rb
Overview
:nodoc:
Direct Known Subclasses
Constant Summary collapse
- TYPE_STR_ATTRS =
%w[t s].freeze
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
-
#raw_string ⇒ Object
readonly
Returns the value of attribute raw_string.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from CellData
Instance Method Summary collapse
- #data ⇒ Object
- #display_url_string? ⇒ Boolean
-
#initialize(index, xf, raw_string) ⇒ StringCellData
constructor
A new instance of StringCellData.
- #write_cell(worksheet, row, row_name, col) ⇒ Object
Methods inherited from CellData
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
Constructor Details
#initialize(index, xf, raw_string) ⇒ StringCellData
Returns a new instance of StringCellData.
65 66 67 68 69 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 65 def initialize(index, xf, raw_string) @token = index @xf = xf @raw_string = raw_string end |
Instance Attribute Details
#raw_string ⇒ Object (readonly)
Returns the value of attribute raw_string.
63 64 65 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 63 def raw_string @raw_string end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
63 64 65 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 63 def token @token end |
Instance Method Details
#data ⇒ Object
71 72 73 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 71 def data { sst_id: token } end |
#display_url_string? ⇒ Boolean
84 85 86 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 84 def display_url_string? false end |
#write_cell(worksheet, row, row_name, col) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 76 def write_cell(worksheet, row, row_name, col) attributes = cell_attributes(worksheet, row, row_name, col) attributes << TYPE_STR_ATTRS worksheet.writer.tag_elements('c', attributes) do worksheet.write_cell_value(token) end end |