Class: Cequel::Metal::Writer Abstract Private
- Inherits:
-
Object
- Object
- Cequel::Metal::Writer
- Extended by:
- Util::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.
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 Attribute Summary collapse
- #type_hints ⇒ Object private
Instance Method Summary collapse
-
#execute(options = {}) ⇒ void
private
Execute the statement as a write operation.
-
#initialize(data_set, &block) ⇒ Writer
constructor
private
A new instance of Writer.
Methods included from Util::Forwardable
Constructor Details
#initialize(data_set, &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.
21 22 23 24 25 |
# File 'lib/cequel/metal/writer.rb', line 21 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 Attribute Details
#type_hints ⇒ Object
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.
16 17 18 |
# File 'lib/cequel/metal/writer.rb', line 16 def type_hints @type_hints end |
Instance Method Details
#execute(options = {}) ⇒ 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
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/cequel/metal/writer.rb', line 39 def execute( = {}) .assert_valid_keys(:timestamp, :ttl, :consistency) return if empty? statement = Statement.new consistency = .fetch(:consistency, data_set.query_consistency) write_to_statement(statement, ) statement.append(*data_set.row_specifications_cql) data_set.(statement, consistency: consistency) end |