Class: Influxdb::Arel::Clauses::WhereClause
Instance Method Summary
collapse
#bottom, #count, #derivative, #difference, #distinct, #first, #histogram, #last, #max, #mean, #median, #min, #mode, #percentile, #stddev, #sum, #top
Methods inherited from Base
#o
Constructor Details
#initialize(conditions, &block) ⇒ WhereClause
Returns a new instance of WhereClause.
7
8
9
10
|
# File 'lib/influxdb/arel/clauses/where_clause.rb', line 7
def initialize(conditions, &block)
@conditions = build_where_expression(conditions)
super(&block)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
20
21
22
|
# File 'lib/influxdb/arel/clauses/where_clause.rb', line 20
def method_missing(method, *args, &block)
a(method)
end
|
Instance Method Details
12
13
14
|
# File 'lib/influxdb/arel/clauses/where_clause.rb', line 12
def a(name)
Nodes::Attribute.new(name) end
|
16
17
18
|
# File 'lib/influxdb/arel/clauses/where_clause.rb', line 16
def now
Nodes::Now.new
end
|
24
25
26
|
# File 'lib/influxdb/arel/clauses/where_clause.rb', line 24
def to_arel
super{|result| [@conditions, result].flatten.compact.inject(&:and) }
end
|