Class: Procrastinator::TaskStore::SimpleCommaStore::CSVFileTransaction

Inherits:
FileTransaction
  • Object
show all
Defined in:
lib/procrastinator/task_store/simple_comma_store.rb

Overview

Adds CSV parsing to the file reading

Instance Method Summary collapse

Methods inherited from FileTransaction

#initialize, #read, #write

Constructor Details

This class inherits a constructor from Procrastinator::FileTransaction

Instance Method Details

#transact(writable: nil) ⇒ Object

Completes the given block as an atomic transaction locked using a global mutex table. The block is provided the current file contents. The block’s result is written to the file.



144
145
146
147
148
# File 'lib/procrastinator/task_store/simple_comma_store.rb', line 144

def transact(writable: nil)
   super do |file_str|
      yield(parse(file_str))
   end
end