Class: Dentaku::BulkExpressionSolver::PermissiveEvaluator
- Inherits:
-
Object
- Object
- Dentaku::BulkExpressionSolver::PermissiveEvaluator
- Defined in:
- lib/dentaku/bulk_expression_solver.rb
Instance Method Summary collapse
- #evaluate(*args) ⇒ Object
-
#initialize(calculator, block) ⇒ PermissiveEvaluator
constructor
A new instance of PermissiveEvaluator.
Constructor Details
#initialize(calculator, block) ⇒ PermissiveEvaluator
Returns a new instance of PermissiveEvaluator.
20 21 22 23 |
# File 'lib/dentaku/bulk_expression_solver.rb', line 20 def initialize(calculator, block) @calculator = calculator @block = block || ->(*) { :undefined } end |
Instance Method Details
#evaluate(*args) ⇒ Object
25 26 27 28 29 |
# File 'lib/dentaku/bulk_expression_solver.rb', line 25 def evaluate(*args) @calculator.evaluate(*args) { |expr, ex| @block.call(ex) } end |