Class: Cequel::Metal::Writer Abstract Private
- Inherits:
-
Object
- Object
- Cequel::Metal::Writer
- Extended by:
- Forwardable
- Defined in:
- lib/cequel/metal/writer.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 class is abstract.
Subclasses must implement #write_to_statement, which writes internal state to a Statement instance
Internal representation of a data manipulation statement
Direct Known Subclasses
Instance Method Summary collapse
-
#execute ⇒ void
private
Execute the statement as a write operation.
-
#initialize(data_set, options = {}, &block) ⇒ Writer
constructor
private
A new instance of Writer.
Constructor Details
#initialize(data_set, options = {}, &block) ⇒ Writer
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 Writer.
23 24 25 26 27 |
# File 'lib/cequel/metal/writer.rb', line 23 def initialize(data_set, = {}, &block) @data_set, @options, @block = data_set, , block @statements, @bind_vars = [], [] SimpleDelegator.new(self).instance_eval(&block) if block end |
Instance Method Details
#execute ⇒ void
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.
This method returns an undefined value.
Execute the statement as a write operation
34 35 36 37 38 39 40 |
# File 'lib/cequel/metal/writer.rb', line 34 def execute return if empty? statement = Statement.new write_to_statement(statement) statement.append(*data_set.row_specifications_cql) data_set.write(*statement.args) end |