Class: Writexlsx::Worksheet::NumberCellData

Inherits:
CellData
  • Object
show all
Defined in:
lib/write_xlsx/worksheet/cell_data.rb

Overview

:nodoc:

Direct Known Subclasses

DateTimeCellData

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

Attributes inherited from CellData

#xf

Instance Method Summary collapse

Methods inherited from CellData

#cell_attributes, #display_url_string?

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(num, xf) ⇒ NumberCellData

Returns a new instance of NumberCellData.



46
47
48
49
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 46

def initialize(num, xf)
  @token = num
  @xf = xf
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



44
45
46
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 44

def token
  @token
end

Instance Method Details

#dataObject



51
52
53
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 51

def data
  @token
end

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



55
56
57
58
59
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 55

def write_cell(worksheet, row, row_name, col)
  worksheet.writer.tag_elements('c', cell_attributes(worksheet, row, row_name, col)) do
    worksheet.write_cell_value(token)
  end
end