Method: Cequel::Record::Bound.create

Defined in:
lib/cequel/record/bound.rb

.create(column, gt, inclusive, value) ⇒ Bound

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.

Create a bound object for the given column. This method returns an instance of the appropriate Bound subclass given the type of the column and the class of the value.

Parameters:

  • column (Schema::Column)

    column bound applies to

  • gt (Boolean)

    true if this is a lower bound

  • inclusive (Boolean)

    true if this is an inclusive bound

  • value

    value for bound

Returns:

  • (Bound)

    instance of appropriate bound implementation

Since:

  • 1.0.0



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/cequel/record/bound.rb', line 27

def self.create(column, gt, inclusive, value)
  implementation =
    if column.partition_key?
      PartitionKeyBound
    elsif column.type?(:timeuuid) && !Cequel.uuid?(value)
      TimeuuidBound
    else
      ClusteringColumnBound
    end

  implementation.new(column, gt, inclusive, value)
end