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



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

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:



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

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

Instance Method Details

#buildMetal::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.

Returns a DataSet exposing the rows for the record set.

Returns:



36
37
38
39
40
41
42
43
44
# File 'lib/cequel/record/data_set_builder.rb', line 36

def build
  add_limit
  add_select_columns
  add_where_statement
  add_bounds
  add_order
  set_consistency
  data_set
end