Class: ExcelFormula
- Inherits:
-
Object
- Object
- ExcelFormula
- Defined in:
- lib/surpass/excel_formula.rb
Constant Summary collapse
- NO_CALCS =
0x00
- RECALC_ALWAYS =
0x01
- CALC_ON_OPEN =
0x02
- PART_OF_SHARED_FORMULA =
0x08
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(formula_string) ⇒ ExcelFormula
constructor
A new instance of ExcelFormula.
- #to_biff ⇒ Object
Constructor Details
#initialize(formula_string) ⇒ ExcelFormula
Returns a new instance of ExcelFormula.
9 10 11 12 13 14 15 16 17 |
# File 'lib/surpass/excel_formula.rb', line 9 def initialize(formula_string) @parser = ExcelFormulaParser.new(formula_string) # begin @parser.formula # rescue RuntimeError => e # puts e # raise "invalid Excel formula" # end end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
7 8 9 |
# File 'lib/surpass/excel_formula.rb', line 7 def parser @parser end |
Instance Method Details
#to_biff ⇒ Object
19 20 21 22 |
# File 'lib/surpass/excel_formula.rb', line 19 def to_biff rpn = @parser.rpn [rpn.size].pack('v') + rpn end |