Class: Spinoza::DeleteOperation
- Defined in:
- lib/spinoza/system/operation.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Attributes inherited from Operation
Instance Method Summary collapse
- #execute(ds) ⇒ Object
-
#initialize(txn = nil, table: nil, key: nil) ⇒ DeleteOperation
constructor
A new instance of DeleteOperation.
- #inspect ⇒ Object
Methods inherited from Operation
Constructor Details
#initialize(txn = nil, table: nil, key: nil) ⇒ DeleteOperation
Returns a new instance of DeleteOperation.
66 67 68 69 |
# File 'lib/spinoza/system/operation.rb', line 66 def initialize txn = nil, table: nil, key: nil @txn = txn @table, @key = table, key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
65 66 67 |
# File 'lib/spinoza/system/operation.rb', line 65 def key @key end |
Instance Method Details
#execute(ds) ⇒ Object
71 72 73 |
# File 'lib/spinoza/system/operation.rb', line 71 def execute ds ds.where(key).delete end |
#inspect ⇒ Object
75 76 77 |
# File 'lib/spinoza/system/operation.rb', line 75 def inspect "<delete #{table} #{key}>" end |