Class: Influxdb::Arel::Clauses::SelectClause
- Includes:
- Expressions
- Defined in:
- lib/influxdb/arel/clauses/select_clause.rb
Instance Method Summary collapse
- #a(name) ⇒ Object
-
#initialize(*attributes, &block) ⇒ SelectClause
constructor
A new instance of SelectClause.
- #method_missing(method, *args, &block) ⇒ Object
- #to_arel ⇒ Object
Methods included from Expressions
#bottom, #count, #derivative, #difference, #distinct, #first, #histogram, #last, #max, #mean, #median, #min, #mode, #percentile, #stddev, #sum, #top
Methods inherited from Base
Constructor Details
#initialize(*attributes, &block) ⇒ SelectClause
Returns a new instance of SelectClause.
7 8 9 10 |
# File 'lib/influxdb/arel/clauses/select_clause.rb', line 7 def initialize(*attributes, &block) @attributes = attributes super(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
16 17 18 |
# File 'lib/influxdb/arel/clauses/select_clause.rb', line 16 def method_missing(method, *args, &block) a(method) end |
Instance Method Details
#a(name) ⇒ Object
12 13 14 |
# File 'lib/influxdb/arel/clauses/select_clause.rb', line 12 def a(name) Nodes::Attribute.new(name) end |
#to_arel ⇒ Object
20 21 22 |
# File 'lib/influxdb/arel/clauses/select_clause.rb', line 20 def to_arel super{|result| result ? (@attributes | Array(result)) : @attributes } end |