Class: Spinoza::InsertOperation

Inherits:
Operation show all
Defined in:
lib/spinoza/system/operation.rb

Instance Attribute Summary collapse

Attributes inherited from Operation

#table

Instance Method Summary collapse

Constructor Details

#initialize(txn = nil, table: nil, row: nil) ⇒ InsertOperation

Returns a new instance of InsertOperation.



26
27
28
29
# File 'lib/spinoza/system/operation.rb', line 26

def initialize txn = nil, table: nil, row: nil
  @txn = txn
  @table, @row = table, row
end

Instance Attribute Details

#rowObject (readonly)

Returns the value of attribute row.



25
26
27
# File 'lib/spinoza/system/operation.rb', line 25

def row
  @row
end

Instance Method Details

#check(lm) ⇒ Object



35
36
37
# File 'lib/spinoza/system/operation.rb', line 35

def check lm
  true
end

#execute(ds) ⇒ Object



31
32
33
# File 'lib/spinoza/system/operation.rb', line 31

def execute ds
  ds << row
end

#inspectObject



39
40
41
# File 'lib/spinoza/system/operation.rb', line 39

def inspect
  "<insert #{table}: #{row}>"
end