Method: Cequel::Metal::RowSpecification#cql

Defined in:
lib/cequel/metal/row_specification.rb

#cqlString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns row specification as CQL fragment.

Returns:

  • (String)

    row specification as CQL fragment

Since:

  • 1.0.0



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cequel/metal/row_specification.rb', line 36

def cql
  case @value
  when Array
    if @value.length == 1
      ["#{@column} = ?", @value.first]
    else
      ["#{@column} IN (?)", @value]
    end
  else
    ["#{@column} = ?", @value]
  end
end