Class: Statsample::Formula
Overview
To process formula language
Instance Attribute Summary collapse
-
#canonical_tokens ⇒ Object
readonly
Returns the value of attribute canonical_tokens.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #canonical_to_s ⇒ Object
-
#initialize(tokens) ⇒ Formula
constructor
A new instance of Formula.
Constructor Details
#initialize(tokens) ⇒ Formula
Returns a new instance of Formula.
122 123 124 125 |
# File 'lib/statsample/formula/formula.rb', line 122 def initialize(tokens) @tokens = tokens @canonical_tokens = parse_formula end |
Instance Attribute Details
#canonical_tokens ⇒ Object (readonly)
Returns the value of attribute canonical_tokens.
120 121 122 |
# File 'lib/statsample/formula/formula.rb', line 120 def canonical_tokens @canonical_tokens end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
120 121 122 |
# File 'lib/statsample/formula/formula.rb', line 120 def tokens @tokens end |
Instance Method Details
#canonical_to_s ⇒ Object
127 128 129 |
# File 'lib/statsample/formula/formula.rb', line 127 def canonical_to_s canonical_tokens.join '+' end |