Class: Greenroom::CLI::Judge::Evaluation

Inherits:
Object
  • Object
show all
Defined in:
lib/greenroom/cli/judge.rb

Instance Method Summary collapse

Constructor Details

#initialize(events, config, repository) ⇒ Evaluation

Returns a new instance of Evaluation.



88
89
90
91
92
# File 'lib/greenroom/cli/judge.rb', line 88

def initialize(events, config, repository)
  @events = events
  @config = config
  @repository = File.expand_path(repository)
end

Instance Method Details

#callObject



94
95
96
97
98
99
100
# File 'lib/greenroom/cli/judge.rb', line 94

def call
  valid, errors = readable_events
  verdicts = valid.group_by { |event| event.fetch("experiment") }.map do |name, entries|
    evaluate(name, deduplicate(entries))
  end
  [verdicts, errors]
end