Class: Rooq::CastExpression

Inherits:
Expression show all
Extended by:
T::Sig
Defined in:
lib/rooq/expression.rb

Overview

CAST expression

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#%, #*, #+, #-, #/, #as, #asc, #between, #desc, #eq, #gt, #gte, #in, #is_not_null, #is_null, #like, #lt, #lte, #ne, #to_sql

Constructor Details

#initialize(expression, target_type) ⇒ void

Parameters:

  • expression (Expression)
  • target_type (String, Symbol)


483
484
485
486
487
# File 'lib/rooq/expression.rb', line 483

def initialize(expression, target_type)
  @expression = expression
  @target_type = target_type
  freeze
end

Instance Attribute Details

#expressionExpression (readonly)

Returns:



477
478
479
# File 'lib/rooq/expression.rb', line 477

def expression
  @expression
end

#target_typeString, Symbol (readonly)

Returns:

  • (String, Symbol)


480
481
482
# File 'lib/rooq/expression.rb', line 480

def target_type
  @target_type
end