Module: Influxdb::Arel::Predications

Included in:
Attributes::Attribute, Nodes::Grouping, Nodes::InfixOperation, Nodes::SqlLiteral
Defined in:
lib/influxdb/arel/predications.rb

Instance Method Summary collapse

Instance Method Details

#does_not_match(other) ⇒ Object



65
66
67
# File 'lib/influxdb/arel/predications.rb', line 65

def does_not_match(other)
  Nodes::DoesNotMatch.new(self, other)
end

#does_not_match_all(others) ⇒ Object



73
74
75
# File 'lib/influxdb/arel/predications.rb', line 73

def does_not_match_all(others)
  grouping_all(:does_not_match, others)
end

#does_not_match_any(others) ⇒ Object



69
70
71
# File 'lib/influxdb/arel/predications.rb', line 69

def does_not_match_any(others)
  grouping_any(:does_not_match, others)
end

#eq(other) ⇒ Object



16
17
18
# File 'lib/influxdb/arel/predications.rb', line 16

def eq(other)
  Nodes::Equality.new(self, other)
end

#eq_all(others) ⇒ Object



24
25
26
# File 'lib/influxdb/arel/predications.rb', line 24

def eq_all(others)
  grouping_all(:eq, others)
end

#eq_any(others) ⇒ Object



20
21
22
# File 'lib/influxdb/arel/predications.rb', line 20

def eq_any(others)
  grouping_any(:eq, others)
end

#gt(right) ⇒ Object



89
90
91
# File 'lib/influxdb/arel/predications.rb', line 89

def gt(right)
  Nodes::GreaterThan.new(self, right)
end

#gt_all(others) ⇒ Object



97
98
99
# File 'lib/influxdb/arel/predications.rb', line 97

def gt_all(others)
  grouping_all(:gt, others)
end

#gt_any(others) ⇒ Object



93
94
95
# File 'lib/influxdb/arel/predications.rb', line 93

def gt_any(others)
  grouping_any(:gt, others)
end

#gteq(right) ⇒ Object



77
78
79
# File 'lib/influxdb/arel/predications.rb', line 77

def gteq(right)
  Nodes::GreaterThanOrEqual.new(self, right)
end

#gteq_all(others) ⇒ Object



85
86
87
# File 'lib/influxdb/arel/predications.rb', line 85

def gteq_all(others)
  grouping_all(:gteq, others)
end

#gteq_any(others) ⇒ Object



81
82
83
# File 'lib/influxdb/arel/predications.rb', line 81

def gteq_any(others)
  grouping_any(:gteq, others)
end

#in(other) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/influxdb/arel/predications.rb', line 28

def in(other)
  case other
  when Range
    if other.begin == -Float::INFINITY && other.end == Float::INFINITY
      Nodes::Equality.new(1, 1)
    elsif other.end == Float::INFINITY
      Nodes::GreaterThanOrEqual.new(self, other.begin)
    elsif other.begin == -Float::INFINITY && other.exclude_end?
      Nodes::LessThan.new(self, other.end)
    elsif other.begin == -Float::INFINITY
      Nodes::LessThanOrEqual.new(self, other.end)
    elsif other.exclude_end?
      left = Nodes::GreaterThanOrEqual.new(self, other.begin)
      right = Nodes::LessThan.new(self, other.end)
      Nodes::And.new([left, right])
    else
      left = Nodes::GreaterThanOrEqual.new(self, other.begin)
      right = Nodes::LessThanOrEqual.new(self, other.end)
      Nodes::And.new([left, right])
    end
  else
    Nodes::In.new(self, other)
  end
end

#lt(right) ⇒ Object



101
102
103
# File 'lib/influxdb/arel/predications.rb', line 101

def lt(right)
  Nodes::LessThan.new(self, right)
end

#lt_all(others) ⇒ Object



109
110
111
# File 'lib/influxdb/arel/predications.rb', line 109

def lt_all(others)
  grouping_all(:lt, others)
end

#lt_any(others) ⇒ Object



105
106
107
# File 'lib/influxdb/arel/predications.rb', line 105

def lt_any(others)
  grouping_any(:lt, others)
end

#lteq(right) ⇒ Object



113
114
115
# File 'lib/influxdb/arel/predications.rb', line 113

def lteq(right)
  Nodes::LessThanOrEqual.new(self, right)
end

#lteq_all(others) ⇒ Object



121
122
123
# File 'lib/influxdb/arel/predications.rb', line 121

def lteq_all(others)
  grouping_all(:lteq, others)
end

#lteq_any(others) ⇒ Object



117
118
119
# File 'lib/influxdb/arel/predications.rb', line 117

def lteq_any(others)
  grouping_any(:lteq, others)
end

#matches(other) ⇒ Object



53
54
55
# File 'lib/influxdb/arel/predications.rb', line 53

def matches(other)
  Nodes::Matches.new(self, other)
end

#matches_all(others) ⇒ Object



61
62
63
# File 'lib/influxdb/arel/predications.rb', line 61

def matches_all(others)
  grouping_all(:matches, others)
end

#matches_any(others) ⇒ Object



57
58
59
# File 'lib/influxdb/arel/predications.rb', line 57

def matches_any(others)
  grouping_any(:matches, others)
end

#not_eq(other) ⇒ Object



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

def not_eq(other)
  Nodes::NotEqual.new(self, other)
end

#not_eq_all(others) ⇒ Object



12
13
14
# File 'lib/influxdb/arel/predications.rb', line 12

def not_eq_all(others)
  grouping_all(:not_eq, others)
end

#not_eq_any(others) ⇒ Object



8
9
10
# File 'lib/influxdb/arel/predications.rb', line 8

def not_eq_any(others)
  grouping_any(:not_eq, others)
end