Class: JDBCHelper::SQL::CriterionExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/jdbc-helper/sql/expression.rb

Overview

Since:

  • 0.7.0

Instance Method Summary collapse

Methods inherited from Expression

#==, #eql?, #hash

Constructor Details

#initialize(operator, param) ⇒ CriterionExpression

Returns a new instance of CriterionExpression.

Since:

  • 0.7.0



130
131
132
133
# File 'lib/jdbc-helper/sql/expression.rb', line 130

def initialize operator, param
  @operator = operator
  @param = param
end

Instance Method Details

#to_bindObject

Since:

  • 0.7.0



139
140
141
# File 'lib/jdbc-helper/sql/expression.rb', line 139

def to_bind
  [[@operator, '?'].join(' '), [@param]]
end

#to_sObject

Since:

  • 0.7.0



135
136
137
# File 'lib/jdbc-helper/sql/expression.rb', line 135

def to_s
  [@operator, SQL.value(@param)].join(' ')
end