Class: Writexlsx::Worksheet::FormulaArrayCellData

Inherits:
CellData
  • Object
show all
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

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(formula, xf, range, result) ⇒ FormulaArrayCellData

Returns a new instance of FormulaArrayCellData.



136
137
138
139
140
141
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 136

def initialize(formula, xf, range, result)
  @token = formula
  @xf = xf
  @range = range
  @result = result
end

Instance Attribute Details

Returns the value of attribute link_type.



134
135
136
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 134

def link_type
  @link_type
end

#rangeObject (readonly)

Returns the value of attribute range.



134
135
136
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 134

def range
  @range
end

#resultObject (readonly)

Returns the value of attribute result.



134
135
136
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 134

def result
  @result
end

#tokenObject (readonly)

Returns the value of attribute token.



134
135
136
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 134

def token
  @token
end

#urlObject (readonly)

Returns the value of attribute url.



134
135
136
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 134

def url
  @url
end

Instance Method Details

#dataObject



143
144
145
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 143

def data
  @result || 0
end

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



147
148
149
150
151
152
# File 'lib/write_xlsx/worksheet/cell_data.rb', line 147

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