parsecom 0.5.5 → 0.5.6
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.
- data/lib/parse/query.rb +10 -0
- data/lib/parse/version.rb +1 -1
- metadata +1 -1
data/lib/parse/query.rb
CHANGED
@@ -263,6 +263,16 @@ module Parse
|
|
263
263
|
self
|
264
264
|
end
|
265
265
|
|
266
|
+
def regex regex
|
267
|
+
@conditions.push ['$regex', regex.source]
|
268
|
+
self
|
269
|
+
end
|
270
|
+
|
271
|
+
# https://parse.com/questions/are-like-or-regex-queries-possible-via-the-rest-api
|
272
|
+
def starts_with str
|
273
|
+
regex %r|^\Q#{str}\E|
|
274
|
+
end
|
275
|
+
|
266
276
|
def to_s
|
267
277
|
if @conditions.size == 1 && !@conditions[0].is_a?(Array)
|
268
278
|
"#{@column_name.to_s.inspect}:#{condition_to_s @conditions[0]}"
|
data/lib/parse/version.rb
CHANGED