Class: RubyFromExcel::SharedFormulaCell

Inherits:
FormulaCell show all
Defined in:
lib/cells/shared/shared_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

Instance Method Summary collapse

Methods inherited from FormulaCell

#parse_xml

Methods inherited from Cell

#alter_other_cells_if_required, #can_be_replaced_with_value?, #initialize, #inspect, #parse_xml, #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

#shared_formulaObject

Returns the value of attribute shared_formula


5
6
7
# File 'lib/cells/shared/shared_formula_cell.rb', line 5

def shared_formula
  @shared_formula
end

#shared_formula_offsetObject

Returns the value of attribute shared_formula_offset


6
7
8
# File 'lib/cells/shared/shared_formula_cell.rb', line 6

def shared_formula_offset
  @shared_formula_offset
end

Instance Method Details

#debugObject


20
21
22
# File 'lib/cells/shared/shared_formula_cell.rb', line 20

def debug
  # Await the sharing formula
end

#debug_after_sharingObject


24
25
26
# File 'lib/cells/shared/shared_formula_cell.rb', line 24

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

#parse_formulaObject


8
9
10
# File 'lib/cells/shared/shared_formula_cell.rb', line 8

def parse_formula
  # No
end

#ruby_valueObject


16
17
18
# File 'lib/cells/shared/shared_formula_cell.rb', line 16

def ruby_value
  "@#{reference.to_ruby} ||= #{shared_formula.visit(SharedFormulaBuilder.new(self, shared_formula_offset))}"
end

#work_out_dependenciesObject


12
13
14
# File 'lib/cells/shared/shared_formula_cell.rb', line 12

def work_out_dependencies
  self.dependencies ||= shared_formula.visit(SharedFormulaDependencyBuilder.new(self,shared_formula_offset))
end