Class: Flounder::Expression::Named

Inherits:
Expr
  • Object
show all
Defined in:
lib/flounder/expression.rb

Instance Method Summary collapse

Methods inherited from Expr

#&, #as, #cast, #db_quote, #eval, #to_immediate, #|

Constructor Details

#initialize(domain, name, expr) ⇒ Named

Returns a new instance of Named.



66
67
68
69
70
71
# File 'lib/flounder/expression.rb', line 66

def initialize domain, name, expr
  super(domain)

  @name = name
  @expr = expr
end

Instance Method Details

#to_sqlObject



73
74
75
# File 'lib/flounder/expression.rb', line 73

def to_sql
  @expr.to_sql << ' AS ' << @name.to_s
end