ruby-montage 1.2.0 → 1.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ad2f36315b6d08ab4b631d6294d0e16adb48077
4
- data.tar.gz: 04447618fc62e0776b7ba47e20574cc441720953
3
+ metadata.gz: e7cfab61db32ca8704bc63dab08eb942f1c4c389
4
+ data.tar.gz: 213ba2d7af6eca156a881c99251569ee49d72851
5
5
  SHA512:
6
- metadata.gz: e5c8e150825baba19131a674920349f2e3a5baa80ec451a18b529b961776bdcd2c38950023122dc6343909ff6e0d9ecefa4413fd3896326f8b2b21376c764461
7
- data.tar.gz: daf00f4f90bd696947774f0aaa8cee3557f76efd9c3f73d548f3787fae8cfb610c208c5ed390ca606c611df1a9c04ac32844ddddfd8c49afcfa8d5dc594bd1e5
6
+ metadata.gz: a858e45b19d1d62eb2729940995c500567c9902ac322682c35aab09be8efbb5bc27c38e12e56b98cf85aeab2aa2b6bf65b639193a4c3ad31955506e9dd47ed5c
7
+ data.tar.gz: 9029fac2253d995e29a695aeceee06aaec392ff6828ff27a0fa3cf5f17d808f79c257eacfd4ae31cfe8e11257deec8617adc4aced899c8b8e4729b9f1e926adb
@@ -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* :
@@ -1,3 +1,3 @@
1
1
  module Montage
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
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.2.0
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-03 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler