ruby-montage 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/montage/query.rb +28 -0
- data/lib/montage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7cfab61db32ca8704bc63dab08eb942f1c4c389
|
4
|
+
data.tar.gz: 213ba2d7af6eca156a881c99251569ee49d72851
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a858e45b19d1d62eb2729940995c500567c9902ac322682c35aab09be8efbb5bc27c38e12e56b98cf85aeab2aa2b6bf65b639193a4c3ad31955506e9dd47ed5c
|
7
|
+
data.tar.gz: 9029fac2253d995e29a695aeceee06aaec392ff6828ff27a0fa3cf5f17d808f79c257eacfd4ae31cfe8e11257deec8617adc4aced899c8b8e4729b9f1e926adb
|
data/lib/montage/query.rb
CHANGED
@@ -153,6 +153,34 @@ module Montage
|
|
153
153
|
clone.tap { |r| r.merge_array(["$pluck", args.map(&:to_s)]) }
|
154
154
|
end
|
155
155
|
|
156
|
+
# Perform a `between` filter on the query
|
157
|
+
#
|
158
|
+
# * *Attributes* :
|
159
|
+
# - +from+ -> The lower bound for the between filter. Can be a number, a
|
160
|
+
# letter, or a string representation of a date.
|
161
|
+
# +to+ -> The upper bound for the between filter. Can be a number, a
|
162
|
+
# letter, or a string representation of a date.
|
163
|
+
# +index+ -> The index to use when performing this filter
|
164
|
+
# * *Example* :
|
165
|
+
# - @query.between(from: 1, to: 3, index: 'rank')
|
166
|
+
# => {"$schema"=>"test", "$query"=>[["$filter", []], ["$between", [1, 3, 'rank']]]}
|
167
|
+
# * *Returns* :
|
168
|
+
# - A copy of self
|
169
|
+
def between(args = {})
|
170
|
+
unless args[:from] && args[:to]
|
171
|
+
fail(
|
172
|
+
MissingAttributeError,
|
173
|
+
"You must supply the from and to attributes"
|
174
|
+
)
|
175
|
+
end
|
176
|
+
|
177
|
+
clone.tap do |r|
|
178
|
+
r.merge_array([
|
179
|
+
"$between", [args[:from], args[:to], args[:index]].compact
|
180
|
+
])
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
156
184
|
# Specifies an index to use on a query.
|
157
185
|
#
|
158
186
|
# * *Notes* :
|
data/lib/montage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-montage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dphaener
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|