Class: Cassandra::Mocks::Statement::Arithmetic
- Inherits:
-
Struct
- Object
- Struct
- Cassandra::Mocks::Statement::Arithmetic
- Defined in:
- lib/cassandra_mocks/statement/arithmetic.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#column ⇒ Object
Returns the value of attribute column.
-
#operation ⇒ Object
Returns the value of attribute operation.
Instance Method Summary collapse
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount
4 5 6 |
# File 'lib/cassandra_mocks/statement/arithmetic.rb', line 4 def amount @amount end |
#column ⇒ Object
Returns the value of attribute column
4 5 6 |
# File 'lib/cassandra_mocks/statement/arithmetic.rb', line 4 def column @column end |
#operation ⇒ Object
Returns the value of attribute operation
4 5 6 |
# File 'lib/cassandra_mocks/statement/arithmetic.rb', line 4 def operation @operation end |
Instance Method Details
#apply(row) ⇒ Object
6 7 8 |
# File 'lib/cassandra_mocks/statement/arithmetic.rb', line 6 def apply(row) row.merge(column => (row[column] || 0).public_send(operator, amount)) end |