Class: MysqlFramework::InCondition

Inherits:
SqlCondition show all
Defined in:
lib/mysql_framework/in_condition.rb

Overview

This class is used to represent a Sql IN Condition for a column.

Constant Summary

Constants inherited from SqlCondition

SqlCondition::NIL_COMPARISONS

Instance Attribute Summary

Attributes inherited from SqlCondition

#value

Instance Method Summary collapse

Methods inherited from SqlCondition

#initialize

Constructor Details

This class inherits a constructor from MysqlFramework::SqlCondition

Instance Method Details

#to_sObject

This method is called to get the condition as a string for a sql prepared statement



7
8
9
10
# File 'lib/mysql_framework/in_condition.rb', line 7

def to_s
  params = value.map { |_| '?' }
  "#{@column} #{@comparison} (#{params.join(', ')})"
end