Class: ROM::CSV::Commands::Delete
- Inherits:
-
ROM::Commands::Delete
- Object
- ROM::Commands::Delete
- ROM::CSV::Commands::Delete
- Defined in:
- lib/rom/csv/commands/delete.rb
Instance Method Summary collapse
Instance Method Details
#dataset ⇒ Object
22 23 24 |
# File 'lib/rom/csv/commands/delete.rb', line 22 def dataset relation.dataset end |
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rom/csv/commands/delete.rb', line 10 def execute original_data = original_dataset.to_a dataset.each do |dataset_tuple| index = original_data.index(dataset_tuple) original_dataset.data.delete(index) end original_dataset.sync! dataset.data end |
#original_dataset ⇒ Object
26 27 28 |
# File 'lib/rom/csv/commands/delete.rb', line 26 def original_dataset source.dataset end |