downsampler 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69b6e23fcf7ca6d7cfd13deef886f10f0659b6e2
4
- data.tar.gz: 292a7affaa256255e3cdf01b64cd9db90e4b84bb
3
+ metadata.gz: e4aa1a0d4b6b449b9cb98ed1e4a8c307ee2d85be
4
+ data.tar.gz: 518b3e2ba3ce7291ffc90b513faff2bbac05bc91
5
5
  SHA512:
6
- metadata.gz: 4aaff0f40310b3051f959d6bc405d4456f6b63106ef825ca1daa457bb7c4a23b23918531938cefbb665e24f910cf8becafd83f3551c4b05c68fc710338e75c41
7
- data.tar.gz: 7f7fcb4619c21b50db7b1bc830b6f95302bfc9f3fcf22480b683c60ae126e58a10c796782a701a1d4e640fee8f41d4e4537c360426d7aad156800ad0f3c7056b
6
+ metadata.gz: 4558c912dbf16147c2e0c7a63c1fa34cd22cf6f29d918b77768192d34cd13f495da6fba870eb0fc70372a8ac174f828823f32e69bb4ec9fa5d486d6c9fed7208
7
+ data.tar.gz: 3abc8ef57d604d386f0b9c273018fee0cbccbd924ecb9edf7de3ec1f691cce5285a0423673f8042adb9eca0e846f69278d3c7f362d720077180d88071e1a4975
data/.gitignore CHANGED
@@ -13,4 +13,5 @@
13
13
  *.a
14
14
  mkmf.log
15
15
  .ruby-version
16
- /bin
16
+ /bin
17
+ *.gem
@@ -19,7 +19,21 @@ module Downsampler
19
19
 
20
20
  def counts
21
21
  inject({}) do |initial, (key, value)|
22
- initial[key] = values.count
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
@@ -1,3 +1,3 @@
1
1
  module Downsampler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-19 00:00:00.000000000 Z
11
+ date: 2014-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler