filternator 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filternator/filter.rb +6 -1
- data/lib/filternator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 580bcc844e002308ce04d4d7d065b55be8502a93
|
4
|
+
data.tar.gz: ccfa34d6d51b92828046475068553c35c605f07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48bf7cb13193cad57d1c80c5fa958756b8b591eaa7f70f440d2fc24cbe8d0af1f80a26053a2448c658535672f21bd86181b6bc41091fb9d499a88bf361b3dcfe
|
7
|
+
data.tar.gz: 6aea328ce4c15f04752de860b85a5db93a819e917c68085be1ab666451ec79164c43c15f6996b661d602f7387cd07c72695a3c73b72912423847bf8fd837f152
|
data/lib/filternator/filter.rb
CHANGED
@@ -12,7 +12,12 @@ module Filternator
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def stats
|
15
|
-
|
15
|
+
pairs = all_filters.map { |filter|
|
16
|
+
result = apply(filter: filter).count
|
17
|
+
result = result.keys.first if result.is_a?(Hash) # ActiveRecord `group by` fix
|
18
|
+
[ filter, result ]
|
19
|
+
}
|
20
|
+
Hash[pairs]
|
16
21
|
end
|
17
22
|
|
18
23
|
def apply(params)
|
data/lib/filternator/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filternator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.0
|
138
|
+
rubygems_version: 2.1.0
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: A very basic gem for generating JSON responses for collections.
|