Class: CassandraDB::Statements::Insert

Inherits:
Base
  • Object
show all
Defined in:
lib/cassandra_db/statements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#options, #to_s

Constructor Details

#initialize(table:, attributes:) ⇒ Insert

Returns a new instance of Insert.



50
51
52
53
# File 'lib/cassandra_db/statements.rb', line 50

def initialize(table:, attributes:)
  @table = table
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



48
49
50
# File 'lib/cassandra_db/statements.rb', line 48

def attributes
  @attributes
end

#tableObject (readonly)

Returns the value of attribute table.



48
49
50
# File 'lib/cassandra_db/statements.rb', line 48

def table
  @table
end

Instance Method Details

#argumentsObject



59
60
61
# File 'lib/cassandra_db/statements.rb', line 59

def arguments
  attributes
end

#cqlObject



55
56
57
# File 'lib/cassandra_db/statements.rb', line 55

def cql
  @cql ||= "INSERT INTO #{table} (#{field_names}) VALUES (#{field_references})"
end