Class: FastStats::Means
- Inherits:
-
Object
- Object
- FastStats::Means
- Defined in:
- lib/fast_stats/means.rb
Instance Attribute Summary collapse
-
#means ⇒ Object
readonly
Returns the value of attribute means.
Instance Method Summary collapse
- #add(name, val) ⇒ Object
-
#initialize ⇒ Means
constructor
A new instance of Means.
- #summary(round: Mean::DEFAULT_ROUND) ⇒ Object
Constructor Details
#initialize ⇒ Means
Returns a new instance of Means.
10 11 12 |
# File 'lib/fast_stats/means.rb', line 10 def initialize @means = {} end |
Instance Attribute Details
#means ⇒ Object (readonly)
Returns the value of attribute means.
8 9 10 |
# File 'lib/fast_stats/means.rb', line 8 def means @means end |
Instance Method Details
#add(name, val) ⇒ Object
14 15 16 |
# File 'lib/fast_stats/means.rb', line 14 def add(name, val) mean_for(name) << val end |
#summary(round: Mean::DEFAULT_ROUND) ⇒ Object
18 19 20 |
# File 'lib/fast_stats/means.rb', line 18 def summary(round: Mean::DEFAULT_ROUND) means.transform_values { |m| m.summary round: 2 } end |