Class Index [+]

Quicksearch

Arel::Predications

Public Instance Methods

asc() click to toggle source
     # File lib/arel/predications.rb, line 151
151:     def asc
152:       Nodes::Ordering.new self, :asc
153:     end
desc() click to toggle source
     # File lib/arel/predications.rb, line 155
155:     def desc
156:       Nodes::Ordering.new self, :desc
157:     end
does_not_match(other) click to toggle source
    # File lib/arel/predications.rb, line 91
91:     def does_not_match other
92:       Nodes::DoesNotMatch.new self, other
93:     end
does_not_match_all(others) click to toggle source
     # File lib/arel/predications.rb, line 99
 99:     def does_not_match_all others
100:       grouping_all :does_not_match, others
101:     end
does_not_match_any(others) click to toggle source
    # File lib/arel/predications.rb, line 95
95:     def does_not_match_any others
96:       grouping_any :does_not_match, others
97:     end
eq(other) click to toggle source
    # File lib/arel/predications.rb, line 15
15:     def eq other
16:       Nodes::Equality.new self, other
17:     end
eq_all(others) click to toggle source
    # File lib/arel/predications.rb, line 23
23:     def eq_all others
24:       grouping_all :eq, others
25:     end
eq_any(others) click to toggle source
    # File lib/arel/predications.rb, line 19
19:     def eq_any others
20:       grouping_any :eq, others
21:     end
gt(right) click to toggle source
     # File lib/arel/predications.rb, line 115
115:     def gt right
116:       Nodes::GreaterThan.new self, right
117:     end
gt_all(others) click to toggle source
     # File lib/arel/predications.rb, line 123
123:     def gt_all others
124:       grouping_all :gt, others
125:     end
gt_any(others) click to toggle source
     # File lib/arel/predications.rb, line 119
119:     def gt_any others
120:       grouping_any :gt, others
121:     end
gteq(right) click to toggle source
     # File lib/arel/predications.rb, line 103
103:     def gteq right
104:       Nodes::GreaterThanOrEqual.new self, right
105:     end
gteq_all(others) click to toggle source
     # File lib/arel/predications.rb, line 111
111:     def gteq_all others
112:       grouping_all :gteq, others
113:     end
gteq_any(others) click to toggle source
     # File lib/arel/predications.rb, line 107
107:     def gteq_any others
108:       grouping_any :gteq, others
109:     end
in(other) click to toggle source
    # File lib/arel/predications.rb, line 27
27:     def in other
28:       case other
29:       when Arel::SelectManager
30:         Nodes::In.new self, other.to_a.map { |x| x.id }
31:       when Range
32:         if other.exclude_end?
33:           left  = Nodes::GreaterThanOrEqual.new(self, other.begin)
34:           right = Nodes::LessThan.new(self, other.end)
35:           Nodes::And.new left, right
36:         else
37:           Nodes::Between.new(self, Nodes::And.new(other.begin, other.end))
38:         end
39:       else
40:         Nodes::In.new self, other
41:       end
42:     end
in_all(others) click to toggle source
    # File lib/arel/predications.rb, line 48
48:     def in_all others
49:       grouping_all :in, others
50:     end
in_any(others) click to toggle source
    # File lib/arel/predications.rb, line 44
44:     def in_any others
45:       grouping_any :in, others
46:     end
lt(right) click to toggle source
     # File lib/arel/predications.rb, line 127
127:     def lt right
128:       Nodes::LessThan.new self, right
129:     end
lt_all(others) click to toggle source
     # File lib/arel/predications.rb, line 135
135:     def lt_all others
136:       grouping_all :lt, others
137:     end
lt_any(others) click to toggle source
     # File lib/arel/predications.rb, line 131
131:     def lt_any others
132:       grouping_any :lt, others
133:     end
lteq(right) click to toggle source
     # File lib/arel/predications.rb, line 139
139:     def lteq right
140:       Nodes::LessThanOrEqual.new self, right
141:     end
lteq_all(others) click to toggle source
     # File lib/arel/predications.rb, line 147
147:     def lteq_all others
148:       grouping_all :lteq, others
149:     end
lteq_any(others) click to toggle source
     # File lib/arel/predications.rb, line 143
143:     def lteq_any others
144:       grouping_any :lteq, others
145:     end
matches(other) click to toggle source
    # File lib/arel/predications.rb, line 79
79:     def matches other
80:       Nodes::Matches.new self, other
81:     end
matches_all(others) click to toggle source
    # File lib/arel/predications.rb, line 87
87:     def matches_all others
88:       grouping_all :matches, others
89:     end
matches_any(others) click to toggle source
    # File lib/arel/predications.rb, line 83
83:     def matches_any others
84:       grouping_any :matches, others
85:     end
not_eq(other) click to toggle source
   # File lib/arel/predications.rb, line 3
3:     def not_eq other
4:       Nodes::NotEqual.new self, other
5:     end
not_eq_all(others) click to toggle source
    # File lib/arel/predications.rb, line 11
11:     def not_eq_all others
12:       grouping_all :not_eq, others
13:     end
not_eq_any(others) click to toggle source
   # File lib/arel/predications.rb, line 7
7:     def not_eq_any others
8:       grouping_any :not_eq, others
9:     end
not_in(other) click to toggle source
    # File lib/arel/predications.rb, line 52
52:     def not_in other
53:       case other
54:       when Arel::SelectManager
55:         Nodes::NotIn.new self, other.to_a.map { |x| x.id }
56:       when Range
57:         if other.exclude_end?
58:           left  = Nodes::LessThan.new(self, other.begin)
59:           right = Nodes::GreaterThanOrEqual.new(self, other.end)
60:           Nodes::Or.new left, right
61:         else
62:           left  = Nodes::LessThan.new(self, other.begin)
63:           right = Nodes::GreaterThan.new(self, other.end)
64:           Nodes::Or.new left, right
65:         end
66:       else
67:         Nodes::NotIn.new self, other
68:       end
69:     end
not_in_all(others) click to toggle source
    # File lib/arel/predications.rb, line 75
75:     def not_in_all others
76:       grouping_all :not_in, others
77:     end
not_in_any(others) click to toggle source
    # File lib/arel/predications.rb, line 71
71:     def not_in_any others
72:       grouping_any :not_in, others
73:     end

Private Instance Methods

grouping_all(method_id, others) click to toggle source
     # File lib/arel/predications.rb, line 169
169:     def grouping_all method_id, others
170:       first = send method_id, others.shift
171: 
172:       Nodes::Grouping.new others.inject(first) { |memo,expr|
173:         Nodes::And.new(memo, send(method_id, expr))
174:       }
175:     end
grouping_any(method_id, others) click to toggle source
     # File lib/arel/predications.rb, line 161
161:     def grouping_any method_id, others
162:       first = send method_id, others.shift
163: 
164:       Nodes::Grouping.new others.inject(first) { |memo,expr|
165:         Nodes::Or.new(memo, send(method_id, expr))
166:       }
167:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.