Class: RobotLab::To::Evals::ProcEval

Inherits:
Base
  • Object
show all
Defined in:
lib/robot_lab/to/evals/factory.rb

Overview

Wraps a bare callable (proc/lambda) as an Eval.

Instance Method Summary collapse

Methods inherited from Base

#protected_paths

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