Class: Influxdb::Arel::TreeManager

Inherits:
Object
  • Object
show all
Defined in:
lib/influxdb/arel/tree_manager.rb

Direct Known Subclasses

SelectManager

Constant Summary collapse

STRING_OR_SYMBOL_CLASS =
[Symbol, String]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astObject (readonly)

Returns the value of attribute ast.



6
7
8
# File 'lib/influxdb/arel/tree_manager.rb', line 6

def ast
  @ast
end

Instance Method Details

#initialize_copy(other) ⇒ Object



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

def initialize_copy(other)
  super
  @ast = @ast.clone
end

#to_sqlObject



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

def to_sql
  visitor.accept(ast)
end

#visitorObject



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

def visitor
  Visitor.new
end

#where(expr) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/influxdb/arel/tree_manager.rb', line 21

def where(expr)
  expr = expr.ast if TreeManager === expr
  expr = Arel.sql(expr) if String === expr

  ast.wheres << expr
  self
end