Class: CassandraDB::Statements::Update
- Defined in:
- lib/cassandra_db/statements.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #arguments ⇒ Object
- #cql ⇒ Object
-
#initialize(table:, attributes:, conditions:) ⇒ Update
constructor
A new instance of Update.
Methods inherited from Base
Constructor Details
#initialize(table:, attributes:, conditions:) ⇒ Update
Returns a new instance of Update.
79 80 81 82 83 |
# File 'lib/cassandra_db/statements.rb', line 79 def initialize(table:, attributes:, conditions:) @table = table @attributes = attributes @conditions = conditions end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
77 78 79 |
# File 'lib/cassandra_db/statements.rb', line 77 def attributes @attributes end |
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
77 78 79 |
# File 'lib/cassandra_db/statements.rb', line 77 def conditions @conditions end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
77 78 79 |
# File 'lib/cassandra_db/statements.rb', line 77 def table @table end |
Instance Method Details
#arguments ⇒ Object
89 90 91 |
# File 'lib/cassandra_db/statements.rb', line 89 def arguments @arguments ||= attributes.merge(conditions_agruments) end |
#cql ⇒ Object
85 86 87 |
# File 'lib/cassandra_db/statements.rb', line 85 def cql @cql ||= "UPDATE #{table} SET #{filed_mappings} #{where_cql}" end |