Class: Flounder::Expression::Cast

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, type, expr) ⇒ Cast

Returns a new instance of Cast.



53
54
55
56
57
58
# File 'lib/flounder/expression.rb', line 53

def initialize domain, type, expr
  super(domain)

  @type = type
  @expr = expr
end

Instance Method Details

#to_sqlObject



60
61
62
# File 'lib/flounder/expression.rb', line 60

def to_sql
  @expr.to_sql << '::' << @type.to_s
end