Class: RubyFromExcel::SharedFormulaCell
- Inherits:
-
FormulaCell
- Object
- Cell
- FormulaCell
- RubyFromExcel::SharedFormulaCell
- Defined in:
- lib/cells/shared/shared_formula_cell.rb
Instance Attribute Summary collapse
-
#shared_formula ⇒ Object
Returns the value of attribute shared_formula.
-
#shared_formula_offset ⇒ Object
Returns the value of attribute shared_formula_offset.
Attributes inherited from FormulaCell
Attributes inherited from Cell
#dependencies, #reference, #worksheet, #xml_type, #xml_value
Instance Method Summary collapse
- #debug ⇒ Object
- #debug_after_sharing ⇒ Object
- #parse_formula ⇒ Object
- #ruby_value ⇒ Object
- #work_out_dependencies ⇒ Object
Methods inherited from FormulaCell
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_formula ⇒ Object
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_offset ⇒ Object
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
#debug ⇒ Object
20 21 22 |
# File 'lib/cells/shared/shared_formula_cell.rb', line 20 def debug # Await the sharing formula end |
#debug_after_sharing ⇒ Object
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_formula ⇒ Object
8 9 10 |
# File 'lib/cells/shared/shared_formula_cell.rb', line 8 def parse_formula # No end |
#ruby_value ⇒ Object
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_dependencies ⇒ Object
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 |