Class: Influxdb::Arel::Clauses::GroupClause

Inherits:
Base
  • Object
show all
Defined in:
lib/influxdb/arel/clauses/group_clause.rb

Instance Method Summary collapse

Methods inherited from Base

#o

Constructor Details

#initialize(*attributes, &block) ⇒ GroupClause

Returns a new instance of GroupClause.



5
6
7
8
# File 'lib/influxdb/arel/clauses/group_clause.rb', line 5

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



18
19
20
# File 'lib/influxdb/arel/clauses/group_clause.rb', line 18

def method_missing(method, *args, &block)
  a(method)
end

Instance Method Details

#a(name) ⇒ Object



10
11
12
# File 'lib/influxdb/arel/clauses/group_clause.rb', line 10

def a(name)
  Nodes::Attribute.new(name)
end

#time(duration) ⇒ Object



14
15
16
# File 'lib/influxdb/arel/clauses/group_clause.rb', line 14

def time(duration)
  Nodes::Time.new(Arel.arelize(duration))
end

#to_arelObject



22
23
24
# File 'lib/influxdb/arel/clauses/group_clause.rb', line 22

def to_arel
  super{|result| result ? (@attributes | Array(result)) : @attributes }
end