bmg 0.23.0 → 0.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bmg/operator/summarize.rb +20 -0
- data/lib/bmg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e96e3e62ddc057b324fa79c7d248ce423dc396
|
4
|
+
data.tar.gz: 3f5ac0d49fa5e6c5449a67a14c3f2e13b2b4cae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49a504176009211d654fa88e8a8239d3f515ded7e557b73f56b83e69b92ef535d315245d0dfe4276e6914ccc5668c53d857cb8ae59f2510eead17fb5bcda7964
|
7
|
+
data.tar.gz: 4e4863368f8f21be2711b08a3f1682e954759940e22207fd843bb8c158884728e5eb1269643c33b4bd5790dce9a9de72be8a16080832d18001eb4a41c79ac0b2
|
@@ -20,6 +20,26 @@ module Bmg
|
|
20
20
|
|
21
21
|
attr_reader :by, :summarization
|
22
22
|
|
23
|
+
protected # optimization
|
24
|
+
|
25
|
+
def _restrict(type, predicate)
|
26
|
+
return super unless type.knows_attrlist?
|
27
|
+
|
28
|
+
# bottom only uses attributes of the `by` list
|
29
|
+
# and can be pushed down the tree
|
30
|
+
summaries = type.attrlist - by
|
31
|
+
top, bottom = predicate.and_split(summaries)
|
32
|
+
if top == predicate
|
33
|
+
super
|
34
|
+
else
|
35
|
+
op = operand
|
36
|
+
op = op.restrict(bottom)
|
37
|
+
op = op.summarize(by, summarization)
|
38
|
+
op = op.restrict(top)
|
39
|
+
op
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
23
43
|
public
|
24
44
|
|
25
45
|
def each
|
data/lib/bmg/version.rb
CHANGED