Module: MiGA::Result::Stats

Included in:
MiGA::Result
Defined in:
lib/miga/result/stats.rb

Overview

Helper module including stats-specific functions for results

Instance Method Summary collapse

Instance Method Details

#compute_statsObject

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



8
9
10
11
12
13
14
15
16
17
# File 'lib/miga/result/stats.rb', line 8

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

#statsObject

Access the stats entry of results



21
22
23
# File 'lib/miga/result/stats.rb', line 21

def stats
  self[:stats]
end