Class: Influxdb::Arel::DeleteManager

Inherits:
TreeManager show all
Defined in:
lib/influxdb/arel/delete_manager.rb

Constant Summary

Constants inherited from TreeManager

TreeManager::STRING_OR_SYMBOL_CLASS

Instance Attribute Summary

Attributes inherited from TreeManager

#ast

Instance Method Summary collapse

Methods inherited from TreeManager

#initialize_copy, #to_sql, #visitor, #where, #where!, #where_values, #where_values=

Constructor Details

#initializeDeleteManager

Returns a new instance of DeleteManager.



4
5
6
# File 'lib/influxdb/arel/delete_manager.rb', line 4

def initialize
  @ast = Nodes::DeleteStatement.new
end

Instance Method Details

#from(*new_tables, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/influxdb/arel/delete_manager.rb', line 8

def from(*new_tables, &block)
  expr = Clauses::FromClause.new(*new_tables, &block).to_arel

  case expr
  when Array
    regexps, others = separate_tables(expr.to_a)
    ast.regexp = regexps.first if regexps
    ast.tables = others
  when Regexp
    ast.regexp = expr
  else
    ast.tables = Array(expr)
  end

  self
end

#regexp=(value) ⇒ Object



29
30
31
# File 'lib/influxdb/arel/delete_manager.rb', line 29

def regexp=(value)
  ast.regexp = value
end

#tables=(value) ⇒ Object



25
26
27
# File 'lib/influxdb/arel/delete_manager.rb', line 25

def tables=(value)
  ast.tables = value
end