statisfy 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/statisfy/model.rb +7 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6383d7143334e6448a05a5afb28b751f35afc830e04a2ad93dfe58a31a63a55f
4
- data.tar.gz: eaf65b189c72a4fa77a439d4aff01bd6eeacf653036194e70085823433476e4f
3
+ metadata.gz: 1b485c63cd06fb497bc3b0426082f221b99e78ae5d95573fe4b747c0e0ddec5d
4
+ data.tar.gz: 930b4574ad28f2ad09b85fe8ff3c96075bbcbf4585af7520526ba24fa77e6f21
5
5
  SHA512:
6
- metadata.gz: ff8563a77a395cee961fbed96a2b58df75d9d284f737b30341f448cd0cd6f5e7c46b9dd64f3fc077f1c1dafc3ee8de7228f6c48d8bc195fcd5af15f22bd374ac
7
- data.tar.gz: dfb1216d2ffb054c81f9055da931bb8d0e766ff148a95cb090afbccdffd36d27c8fd72fd55d8f5b73f5f0b54e8d381e23ab8392681cf9ea4cf337aac39f5e153
6
+ metadata.gz: 4da2848076d5caf49a8c5e5084763bd5c4625b28bbcb0bb59ae7710382f558667fddbe783507fb4bb1221ba5ce9239e478946317dfbcf55963139137009b5ce7
7
+ data.tar.gz: 1b1e517c2f3676253909cc2583440bdb22b84eb19baa46177c6b4572aa2c6d27ca94fe1cbfee2495e805051cf0fcdf950c69c837af8bd6ad80dd0e0e0a7c1d49
@@ -10,14 +10,14 @@ module Statisfy
10
10
  end
11
11
 
12
12
  module ClassMethods
13
- def count(params)
13
+ def statisfy_count(params)
14
14
  raise ArgumentError, "Missing :as parameter" unless params[:as]
15
15
 
16
16
  class_name = params[:as].to_s.camelize
17
17
 
18
18
  eval <<-RUBY, binding, __FILE__, __LINE__ + 1
19
19
  class ::Statisfy::#{class_name}
20
- include Statisfy::Counter
20
+ include Statisfy::#{params[:type] == :aggregate ? "Aggregate" : "Counter"}
21
21
  end
22
22
  RUBY
23
23
 
@@ -27,9 +27,12 @@ module Statisfy
27
27
  end
28
28
  RUBY
29
29
 
30
- "::Statisfy::#{class_name}".constantize.send(__method__, **params)
30
+ "::Statisfy::#{class_name}".constantize.send(:count, **params)
31
+ end
32
+
33
+ def statisfy_aggregate(params)
34
+ statisfy_count(params.merge(type: :aggregate))
31
35
  end
32
- alias aggregate count
33
36
  end
34
37
  end
35
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statisfy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michaël Villeneuve