Class: TableSaw::Queries::SerializeSqlInClause

Inherits:
Object
  • Object
show all
Defined in:
lib/table_saw/queries/serialize_sql_in_clause.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, column, values) ⇒ SerializeSqlInClause

Returns a new instance of SerializeSqlInClause.



8
9
10
11
12
# File 'lib/table_saw/queries/serialize_sql_in_clause.rb', line 8

def initialize(table_name, column, values)
  @table_name = table_name
  @column = column
  @values = values
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



6
7
8
# File 'lib/table_saw/queries/serialize_sql_in_clause.rb', line 6

def column
  @column
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



6
7
8
# File 'lib/table_saw/queries/serialize_sql_in_clause.rb', line 6

def table_name
  @table_name
end

#valuesObject (readonly)

Returns the value of attribute values.



6
7
8
# File 'lib/table_saw/queries/serialize_sql_in_clause.rb', line 6

def values
  @values
end

Instance Method Details

#callObject



14
15
16
# File 'lib/table_saw/queries/serialize_sql_in_clause.rb', line 14

def call
  "#{column} in (#{serialized_values.join(', ')})"
end