Module: SexyScopes::Arel::Predications

Included in:
ExpressionMethods
Defined in:
lib/sexy_scopes/arel/predications.rb

Instance Method Summary collapse

Instance Method Details

#does_not_match(other) ⇒ Object Also known as: !~



22
23
24
25
26
27
28
# File 'lib/sexy_scopes/arel/predications.rb', line 22

def does_not_match(other, *)
  if Regexp === other
    does_not_match_regexp(other)
  else
    SexyScopes.extend_predicate(super)
  end
end

#does_not_match_regexp(other) ⇒ Object



36
37
38
# File 'lib/sexy_scopes/arel/predications.rb', line 36

def does_not_match_regexp(other)
  matches_regexp(other).not
end

#eq(other) ⇒ Object Also known as: ==



4
5
6
# File 'lib/sexy_scopes/arel/predications.rb', line 4

def eq(other)
  SexyScopes.extend_predicate(super)
end

#gt(other) ⇒ Object Also known as: >



45
46
47
# File 'lib/sexy_scopes/arel/predications.rb', line 45

def gt(other)
  SexyScopes.extend_predicate(super)
end

#gteq(other) ⇒ Object Also known as: >=



40
41
42
# File 'lib/sexy_scopes/arel/predications.rb', line 40

def gteq(other)
  SexyScopes.extend_predicate(super)
end

#in(other) ⇒ Object



9
10
11
# File 'lib/sexy_scopes/arel/predications.rb', line 9

def in(other)
  SexyScopes.extend_predicate(super)
end

#lt(other) ⇒ Object Also known as: <



50
51
52
# File 'lib/sexy_scopes/arel/predications.rb', line 50

def lt(other)
  SexyScopes.extend_predicate(super)
end

#lteq(other) ⇒ Object Also known as: <=



55
56
57
# File 'lib/sexy_scopes/arel/predications.rb', line 55

def lteq(other)
  SexyScopes.extend_predicate(super)
end

#matches(other) ⇒ Object Also known as: =~



13
14
15
16
17
18
19
# File 'lib/sexy_scopes/arel/predications.rb', line 13

def matches(other, *)
  if Regexp === other
    matches_regexp(other)
  else
    SexyScopes.extend_predicate(super)
  end
end

#matches_regexp(other) ⇒ Object



31
32
33
34
# File 'lib/sexy_scopes/arel/predications.rb', line 31

def matches_regexp(other)
  predicate = Arel::Nodes::RegexpMatches.new(self, other)
  SexyScopes.extend_predicate(predicate)
end

#not_eq(other) ⇒ Object Also known as: !=



60
61
62
# File 'lib/sexy_scopes/arel/predications.rb', line 60

def not_eq(other)
  SexyScopes.extend_predicate(super)
end