Class: Parse::Constraint::RegularExpressionConstraint

Inherits:
Parse::Constraint show all
Defined in:
lib/parse/query/constraints.rb

Overview

Equivalent to the `$regex` Parse query operation. Requires that a field value match a regular expression.

q.where :field.like => /ruby_regex/i
:name.like => /Bob/i

Instance Attribute Summary

Attributes inherited from Parse::Constraint

#operand, #operation, #operator, #value

Instance Method Summary collapse

Methods inherited from Parse::Constraint

#as_json, #build, contraint_keyword, create, #formatted_value, formatted_value, #initialize, #key, #precedence, register, #to_s

Constructor Details

This class inherits a constructor from Parse::Constraint

Instance Method Details

#likeRegularExpressionConstraint

A registered method on a symbol to create the constraint. Maps to Parse operator “$regex”.

Examples:

q.where :field.like => /ruby_regex/i

Returns:

# File 'lib/parse/query/constraints.rb', line 498

#regexRegularExpressionConstraint

Alias for #like


507
# File 'lib/parse/query/constraints.rb', line 507

contraint_keyword