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.



147
148
149
150
151
# File 'lib/procrastinator/task_store/simple_comma_store.rb', line 147

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