cacchern 0.0.10 → 0.0.11

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
  SHA256:
3
- metadata.gz: f702c13731d27697d94cd38bcad28345fdc7cb8733fbd08b6c9221118668b5ee
4
- data.tar.gz: aca38396ccdcedf799805af0b7bd8c5c45fb10d988d5d50c8269f766cfb25449
3
+ metadata.gz: 843be6e668774bc2790364ff3da87e796dfcd8b1a37ebe608cf30a4e44df8833
4
+ data.tar.gz: 17a33f5d158637a0dbf664ad5da4fae040203726617db8573aae3cffc8a6aeb0
5
5
  SHA512:
6
- metadata.gz: 55f0540a2e04b29f0d19bc59fbe2afe9848356bdfd1154090734024ac9635db5bafce1517d267485b39465253a4cbf43b8353b430dc9a119a102a89854dfe8a4
7
- data.tar.gz: 8a8d98447bc62a6c2c49af045d85620c3b0094a31d9f3086e2bc0bdcc6e38ab4c3216db48810873d27b5aad73e6ab0a928cecf93c893b39545817ccc163b5b02
6
+ metadata.gz: 28219e58af3036d0dfcbc64bb04d5b759199427c1f40346c13d9a7eaf9b5709e8061c28be863357ee3f7a741dd9220a1777318c2e5ac7b260bca031fa8196095
7
+ data.tar.gz: a9cc677d64499ad9dd7cf7db35a7eae12ababa73da4aeb147cdf3f4924a583d401d014041d498121933b6465ed9fbb19a01a6cfbdd55692190a35bb2916bbd09
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cacchern (0.0.10)
4
+ cacchern (0.0.11)
5
5
  activemodel (>= 5.2.2, < 6.0.0)
6
6
  activesupport (>= 5.2.2, < 6.0.0)
7
7
  redis (>= 4.0.0, < 4.2.0)
@@ -24,7 +24,7 @@ GEM
24
24
  i18n (1.7.0)
25
25
  concurrent-ruby (~> 1.0)
26
26
  jaro_winkler (1.5.2)
27
- minitest (5.12.2)
27
+ minitest (5.13.0)
28
28
  parallel (1.17.0)
29
29
  parser (2.6.3.0)
30
30
  ast (~> 2.4.0)
@@ -27,6 +27,13 @@ module Cacchern
27
27
  self.class.value_class.new(id, score)
28
28
  end
29
29
 
30
+ def where_by_score(min: '-inf', max: '+inf')
31
+ min = min.to_s if min.is_a? Numeric
32
+ max = max.to_s if max.is_a? Numeric
33
+ values = Redis.current.zrangebyscore @key, min, max, withscores: true
34
+ values.map { |value| self.class.value_class.new(value[0], value[1]) }
35
+ end
36
+
30
37
  def order(direction = :asc)
31
38
  values = case direction
32
39
  when :asc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cacchern
4
- VERSION = '0.0.10'
4
+ VERSION = '0.0.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacchern
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shuhei TAKASUGI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-28 00:00:00.000000000 Z
11
+ date: 2019-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel