benelux 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +5 -0
- data/benelux.gemspec +1 -1
- data/lib/benelux.rb +1 -1
- data/lib/benelux/stats.rb +11 -0
- metadata +2 -2
data/CHANGES.txt
CHANGED
data/benelux.gemspec
CHANGED
data/lib/benelux.rb
CHANGED
data/lib/benelux/stats.rb
CHANGED
@@ -108,6 +108,7 @@ module Benelux
|
|
108
108
|
def mean() merge.mean end
|
109
109
|
def min() merge.min end
|
110
110
|
def max() merge.max end
|
111
|
+
def sumsq() merge.sumsq end
|
111
112
|
def sum() merge.sum end
|
112
113
|
def sd() merge.sd end
|
113
114
|
def n() merge.n end
|
@@ -219,6 +220,16 @@ module Benelux
|
|
219
220
|
{ :min => min, :mean => mean, :max => max, :sd => sd, :n => n, :sum => @sum, :sumsq => @sumsq }
|
220
221
|
end
|
221
222
|
|
223
|
+
def self.from_hash(hash={})
|
224
|
+
me = new
|
225
|
+
me.instance_variable_set '@min', hash[:min] || hash['min']
|
226
|
+
me.instance_variable_set '@max', hash[:max] || hash['max']
|
227
|
+
me.instance_variable_set '@n', hash[:n] || hash['n']
|
228
|
+
me.instance_variable_set '@sum', hash[:sum] || hash['sum']
|
229
|
+
me.instance_variable_set '@sumsq', hash[:sumsq] || hash['sumsq']
|
230
|
+
me
|
231
|
+
end
|
232
|
+
|
222
233
|
def to_json
|
223
234
|
to_hash.to_json
|
224
235
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benelux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-15 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|