Class: RubyFromExcel::ArrayFormulaCell

Inherits:
FormulaCell show all
Defined in:
lib/cells/array/array_formula_cell.rb

Instance Attribute Summary collapse

Attributes inherited from FormulaCell

#ast, #original_formula

Attributes inherited from Cell

#dependencies, #reference, #worksheet, #xml_type, #xml_value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Cell

#alter_other_cells_if_required, #can_be_replaced_with_value?, #initialize, #inspect, #test, #to_ruby, #to_s, #to_test, #tolerance_for, #value, #value_for_including

Constructor Details

This class inherits a constructor from RubyFromExcel::Cell

Instance Attribute Details

#array_formula_offsetObject

Returns the value of attribute array_formula_offset


13
14
15
# File 'lib/cells/array/array_formula_cell.rb', line 13

def array_formula_offset
  @array_formula_offset
end

#array_formula_referenceObject

Returns the value of attribute array_formula_reference


12
13
14
# File 'lib/cells/array/array_formula_cell.rb', line 12

def array_formula_reference
  @array_formula_reference
end

Class Method Details

.from_other_cell(cell) ⇒ Object


4
5
6
7
8
9
10
# File 'lib/cells/array/array_formula_cell.rb', line 4

def ArrayFormulaCell.from_other_cell(cell)
  afc = ArrayFormulaCell.new(cell.worksheet)
  afc.reference = cell.reference
  afc.xml_value = cell.xml_value
  afc.xml_type =  cell.xml_type
  afc
end

Instance Method Details

#debugObject


27
28
29
# File 'lib/cells/array/array_formula_cell.rb', line 27

def debug
  # Await the sharing formula
end

#debug_after_sharingObject


31
32
33
# File 'lib/cells/array/array_formula_cell.rb', line 31

def debug_after_sharing
  RubyFromExcel.debug(:cells,"#{worksheet.name}.#{reference} -> array -> #{original_formula.inspect} -> #{array_formula_reference.inspect} offset #{array_formula_offset.inspect} -> #{xml_value} (#{xml_type}) -> #{value_for_including.inspect}")
end

#parse_xml(xml) ⇒ Object


15
16
17
# File 'lib/cells/array/array_formula_cell.rb', line 15

def parse_xml(xml)
  # No
end

#ruby_valueObject


23
24
25
# File 'lib/cells/array/array_formula_cell.rb', line 23

def ruby_value
  "@#{reference.to_ruby} ||= #{array_formula_reference}.array_formula_offset(#{array_formula_offset.join(',')})"
end

#work_out_dependenciesObject


19
20
21
# File 'lib/cells/array/array_formula_cell.rb', line 19

def work_out_dependencies
  # No
end