downsampler 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/downsampler/downsampled_hash.rb +15 -1
- data/lib/downsampler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4aa1a0d4b6b449b9cb98ed1e4a8c307ee2d85be
|
4
|
+
data.tar.gz: 518b3e2ba3ce7291ffc90b513faff2bbac05bc91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4558c912dbf16147c2e0c7a63c1fa34cd22cf6f29d918b77768192d34cd13f495da6fba870eb0fc70372a8ac174f828823f32e69bb4ec9fa5d486d6c9fed7208
|
7
|
+
data.tar.gz: 3abc8ef57d604d386f0b9c273018fee0cbccbd924ecb9edf7de3ec1f691cce5285a0423673f8042adb9eca0e846f69278d3c7f362d720077180d88071e1a4975
|
data/.gitignore
CHANGED
@@ -19,7 +19,21 @@ module Downsampler
|
|
19
19
|
|
20
20
|
def counts
|
21
21
|
inject({}) do |initial, (key, value)|
|
22
|
-
initial[key] =
|
22
|
+
initial[key] = value.count
|
23
|
+
initial
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def max_by &block
|
28
|
+
inject({}) do |initial, (key, value)|
|
29
|
+
initial[key] = value.max_by(&block).instance_eval &block
|
30
|
+
initial
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def min_by &block
|
35
|
+
inject({}) do |initial, (key, value)|
|
36
|
+
initial[key] = value.max_by(&block).instance_eval &block
|
23
37
|
initial
|
24
38
|
end
|
25
39
|
end
|
data/lib/downsampler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: downsampler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Mockler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|