Class: RobotLab::To::Evals::ProcEval
- Defined in:
- lib/robot_lab/to/evals/factory.rb
Overview
Wraps a bare callable (proc/lambda) as an Eval.
Instance Method Summary collapse
-
#initialize(callable) ⇒ ProcEval
constructor
A new instance of ProcEval.
- #score(context) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(callable) ⇒ ProcEval
Returns a new instance of ProcEval.
8 9 10 11 |
# File 'lib/robot_lab/to/evals/factory.rb', line 8 def initialize(callable) super() @callable = callable end |
Instance Method Details
#score(context) ⇒ Object
13 14 15 |
# File 'lib/robot_lab/to/evals/factory.rb', line 13 def score(context) @callable.call(context) end |