Method: CodeRunner::Run#min
- Defined in:
- lib/coderunner/run.rb
#min(variable, complete = false) ⇒ Object
does this run have the minimum value of this variable
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 |
# File 'lib/coderunner/run.rb', line 998 def min(variable, complete=false) #does this run have the minimum value of this variable raise ArgumentError.new("complete must be true or false") unless [TrueClass, FalseClass].include? complete.class @runner.generate_combined_ids ids = @runner.combined_ids if complete ids = ids.find_all{|id| @runner.combined_run_list[id].status == :Complete} min_id = @runner.cmins[variable] ||= ids.sort_by{|id| @runner.combined_run_list[id].send(variable)}[0] else min_id = @runner.mins[variable] ||= ids.sort_by{|id| @runner.combined_run_list[id].send(variable)}[0] end return @runner.combined_run_list[min_id].send(variable) == send(variable) end |