Class: Datafile::FileDataset
- Inherits:
-
Object
- Object
- Datafile::FileDataset
- Includes:
- LogUtils::Logging
- Defined in:
- lib/datafile/workers/file/dataset.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(dataset) ⇒ FileDataset
constructor
A new instance of FileDataset.
- #read ⇒ Object
-
#repo_dir ⇒ Object
check: use (rename to) include dir (or local_repo_dir) - why, why not ???.
Constructor Details
#initialize(dataset) ⇒ FileDataset
Returns a new instance of FileDataset.
15 16 17 |
# File 'lib/datafile/workers/file/dataset.rb', line 15 def initialize( dataset ) @dataset = dataset end |
Class Method Details
.registry ⇒ Object
10 11 12 13 |
# File 'lib/datafile/workers/file/dataset.rb', line 10 def self.registry @@registry ||= FileDatasetRegistry.new @@registry end |
Instance Method Details
#dump ⇒ Object
23 24 25 26 27 |
# File 'lib/datafile/workers/file/dataset.rb', line 23 def dump ## for debuggin dump dataset -- todo (also check if folder exits ??) puts "dataset '#{@dataset.name}' opts=#{@dataset.opts.inspect}" ## use opts.inspect instead of to_json - why? why not? puts " repo-dir '#{repo_dir}'" end |
#read ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/datafile/workers/file/dataset.rb', line 29 def read if @dataset.is_a?( FootballDataset ) logger.info( "read football dataset (file) '#{@dataset.name}', '#{@dataset.setup}'" ) pack = SportDb::DirPackage.new( repo_dir ) pack.read( season: @dataset.setup ) ## note: pass on (optional) setup arg as season (filter) arg for now else logger.info( "TODO/FIX: read dataset (file) '#{@dataset.name}', '#{@dataset.setup}'; sorry" ) end end |
#repo_dir ⇒ Object
check: use (rename to) include dir (or local_repo_dir) - why, why not ???
19 20 21 |
# File 'lib/datafile/workers/file/dataset.rb', line 19 def repo_dir ### check: use (rename to) include dir (or local_repo_dir) - why, why not ??? self.class.registry.lookup( @dataset.name ) end |