Class: Cequel::Record::DataSetBuilder Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/cequel/record/data_set_builder.rb

Overview

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

This is a utility class to construct a Metal::DataSet for a given RecordSet.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record_set) ⇒ DataSetBuilder

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 a new instance of DataSetBuilder.

Parameters:

  • record_set (RecordSet)

    record set for which to construct data set



26
27
28
29
# File 'lib/cequel/record/data_set_builder.rb', line 26

def initialize(record_set)
  @record_set = record_set
  @data_set = record_set.connection[record_set.target_class.table_name]
end

Class Method Details

.build_for(record_set) ⇒ Metal::DataSet

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.

Build a data set for the given record set

Parameters:

  • record_set (RecordSet)

    record set for which to construct data set

Returns:



18
19
20
# File 'lib/cequel/record/data_set_builder.rb', line 18

def self.build_for(record_set)
  new(record_set).build
end

Instance Method Details

#buildObject

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.



32
33
34
35
36
37
38
39
# File 'lib/cequel/record/data_set_builder.rb', line 32

def build
  add_limit
  add_select_columns
  add_where_statement
  add_bounds
  add_order
  data_set
end