Class: Datafile::FileWorker

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging
Defined in:
lib/datafile/workers/file/worker.rb

Overview

check: rename to FileDatafileWorker?? or FileDatafile -why, why not ??

Instance Method Summary collapse

Constructor Details

#initialize(datafile) ⇒ FileWorker

Returns a new instance of FileWorker.



9
10
11
# File 'lib/datafile/workers/file/worker.rb', line 9

def initialize( datafile )
  @datafile = datafile
end

Instance Method Details

#calcObject



23
24
25
26
27
# File 'lib/datafile/workers/file/worker.rb', line 23

def calc
  @datafile.scripts.each do |script|
    script.call
  end
end

#downloadObject



13
14
15
# File 'lib/datafile/workers/file/worker.rb', line 13

def download
  ## note: do NOTHING for now; assume repo already present (unpacked) on local filesystem
end

#dumpObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/datafile/workers/file/worker.rb', line 29

def dump
  @datafile.datasets.each do |dataset|
    dataset.file_worker.dump
  end

  ## also dump scripts
  @datafile.scripts.each do |script|
    script.dump
  end
end

#readObject



17
18
19
20
21
# File 'lib/datafile/workers/file/worker.rb', line 17

def read
  @datafile.datasets.each do |dataset|
    dataset.file_worker.read
  end
end