module MiGA::Result::Stats

Helper module including stats-specific functions for results

Public Instance Methods

compute_stats() click to toggle source

(Re-)calculate and save the statistics for the result

# File lib/miga/result/stats.rb, line 9
def compute_stats
  method = :"compute_stats_#{key}"
  MiGA::MiGA.DEBUG "Result(#{key}).compute_stats"
  stats = self.respond_to?(method, true) ? send(method) : nil
  unless stats.nil?
    self[:stats] = stats
    save
  end
  self[:stats]
end
stats() click to toggle source

Access the stats entry of results

# File lib/miga/result/stats.rb, line 22
def stats
  self[:stats]
end