lib/easymon/checklist.rb in easymon-1.0.9 vs lib/easymon/checklist.rb in easymon-1.1

- old
+ new

@@ -34,15 +34,19 @@ def to_s results.map{|name, result| "#{name}: #{result.to_s}"}.join("\n") + "\n - Total Time - " + Easymon.timing_to_ms(self.timing) + "ms" end - def to_json(*args) - combined = [] + def to_hash + combined = {} results.each do |name, result| - combined << result.to_hash.merge({"name" => name}) + combined[name] = result.to_hash end - combined.to_json + combined + end + + def as_json(*args) + to_hash end def success? return false if results.empty? results.values.all?(&:success?) \ No newline at end of file