Class: DataMapper::Parse::Conditions::Regex
Instance Method Summary
collapse
Methods inherited from Comparison
#initialize, #key_name
Instance Method Details
#as_json ⇒ Object
61
62
63
|
# File 'lib/adapters/parse/query.rb', line 61
def as_json
{ key_name => @value.source }.tap { |value| value["$options"] = options if options.present? }
end
|
#options ⇒ Object
53
54
55
56
57
58
59
|
# File 'lib/adapters/parse/query.rb', line 53
def options
options = @value.options
result = []
result << "i" if options[0] == 1
result << "m" if options[2] == 1
result.join
end
|