Class: Influxdb::Arel::Clauses::FromClause

Inherits:
Base show all
Defined in:
lib/influxdb/arel/clauses/from_clause.rb

Instance Method Summary collapse

Methods inherited from Base

#o

Constructor Details

#initialize(*tables, &block) ⇒ FromClause

Returns a new instance of FromClause.



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

def initialize(*tables, &block)
  @tables = tables
  super(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



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

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

Instance Method Details

#join(*tables) ⇒ Object



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

def join(*tables)
  tables_union(Nodes::Join, tables, :merging)
end

#merge(*tables) ⇒ Object



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

def merge(*tables)
  tables_union(Nodes::Merge, tables, :merging)
end

#t(name) ⇒ Object



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

def t(name)
  Nodes::Table.new(name)
end

#to_arelObject



26
27
28
# File 'lib/influxdb/arel/clauses/from_clause.rb', line 26

def to_arel
  super{|result| result ? (@tables | Array(result)) : @tables }.uniq
end