parsecom 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/parse/query.rb +10 -0
  2. data/lib/parse/version.rb +1 -1
  3. 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
@@ -1,3 +1,3 @@
1
1
  module Parse
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsecom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: