Module: ActiveRecord::Refined::AST::Predications
Overview
Predicate builders shared by symbols, qualified columns and expressions. Imported into the Symbol refinement with Refinement#import_methods, so every method must be defined with def.
Instance Method Summary collapse
- #!=(other) ⇒ Object
- #!~(pattern) ⇒ Object
- #<(other) ⇒ Object
- #<=(other) ⇒ Object
- #==(other) ⇒ Object
- #=~(pattern) ⇒ Object
- #>(other) ⇒ Object
- #>=(other) ⇒ Object
- #between?(min, max) ⇒ Boolean
- #end_with?(suffix) ⇒ Boolean
- #in?(values) ⇒ Boolean
- #include?(substring) ⇒ Boolean
- #like?(pattern) ⇒ Boolean
- #null? ⇒ Boolean
- #start_with?(prefix) ⇒ Boolean
Instance Method Details
#!=(other) ⇒ Object
12 13 14 |
# File 'lib/active_record/refined/ast.rb', line 12 def !=(other) Comparison.new(self, :!=, other) end |
#!~(pattern) ⇒ Object
36 37 38 |
# File 'lib/active_record/refined/ast.rb', line 36 def !~(pattern) Match.new(self, pattern, negated: true) end |
#<(other) ⇒ Object
24 25 26 |
# File 'lib/active_record/refined/ast.rb', line 24 def <(other) Comparison.new(self, :<, other) end |
#<=(other) ⇒ Object
28 29 30 |
# File 'lib/active_record/refined/ast.rb', line 28 def <=(other) Comparison.new(self, :<=, other) end |
#==(other) ⇒ Object
8 9 10 |
# File 'lib/active_record/refined/ast.rb', line 8 def ==(other) Comparison.new(self, :==, other) end |
#=~(pattern) ⇒ Object
32 33 34 |
# File 'lib/active_record/refined/ast.rb', line 32 def =~(pattern) Match.new(self, pattern) end |
#>(other) ⇒ Object
16 17 18 |
# File 'lib/active_record/refined/ast.rb', line 16 def >(other) Comparison.new(self, :>, other) end |
#>=(other) ⇒ Object
20 21 22 |
# File 'lib/active_record/refined/ast.rb', line 20 def >=(other) Comparison.new(self, :>=, other) end |
#between?(min, max) ⇒ Boolean
48 49 50 |
# File 'lib/active_record/refined/ast.rb', line 48 def between?(min, max) In.new(self, min..max) end |
#end_with?(suffix) ⇒ Boolean
60 61 62 |
# File 'lib/active_record/refined/ast.rb', line 60 def end_with?(suffix) Like.new(self, "%#{Like.escape(suffix)}", Like::ESCAPE) end |
#in?(values) ⇒ Boolean
44 45 46 |
# File 'lib/active_record/refined/ast.rb', line 44 def in?(values) In.new(self, values) end |
#include?(substring) ⇒ Boolean
64 65 66 |
# File 'lib/active_record/refined/ast.rb', line 64 def include?(substring) Like.new(self, "%#{Like.escape(substring)}%", Like::ESCAPE) end |
#like?(pattern) ⇒ Boolean
52 53 54 |
# File 'lib/active_record/refined/ast.rb', line 52 def like?(pattern) Like.new(self, pattern) end |
#null? ⇒ Boolean
40 41 42 |
# File 'lib/active_record/refined/ast.rb', line 40 def null? Comparison.new(self, :==, nil) end |