Module: Alf::Sql::SubqueryAs

Includes:
Expr
Defined in:
lib/alf/sql/nodes/subquery_as.rb

Constant Summary

Constants included from Expr

Expr::AND, Expr::AS, Expr::COMMA, Expr::DOT, Expr::EQUAL, Expr::EXISTS, Expr::FALSE, Expr::GREATER, Expr::GREATER_OR_EQUAL, Expr::IN, Expr::LEFT_PARENTHESE, Expr::LESS, Expr::LESS_OR_EQUAL, Expr::NOT, Expr::NOT_EQUAL, Expr::OR, Expr::QUOTE, Expr::RIGHT_PARENTHESE, Expr::SPACE, Expr::TRUE

Instance Method Summary collapse

Methods included from Expr

#each_child, #join?, #limit_or_offset?, #ordering, #set_operator?, #with_insert, #with_push, #with_update

Instance Method Details

#as_nameObject



15
16
17
# File 'lib/alf/sql/nodes/subquery_as.rb', line 15

def as_name
  self[2].last
end

#leftObject Also known as: subquery



6
7
8
# File 'lib/alf/sql/nodes/subquery_as.rb', line 6

def left
  self[1]
end

#rightObject



11
12
13
# File 'lib/alf/sql/nodes/subquery_as.rb', line 11

def right
  self[2]
end

#to_sql(buffer = "") ⇒ Object



19
20
21
22
23
24
# File 'lib/alf/sql/nodes/subquery_as.rb', line 19

def to_sql(buffer = "")
  left.to_sql(buffer)
  buffer << " AS "
  right.to_sql(buffer)
  buffer
end