Class: Datafile::FootballDataset
- Defined in:
- lib/datafile/datasets/dataset.rb
Constant Summary collapse
- @@known_football_datasets =
nil
Instance Attribute Summary
Attributes inherited from Dataset
Class Method Summary collapse
Instance Method Summary collapse
- #file_worker ⇒ Object
-
#initialize(name_easy, opts = {}) ⇒ FootballDataset
constructor
A new instance of FootballDataset.
- #zip_worker ⇒ Object
Methods inherited from Dataset
Constructor Details
#initialize(name_easy, opts = {}) ⇒ FootballDataset
Returns a new instance of FootballDataset.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/datafile/datasets/dataset.rb', line 99 def initialize( name_easy, opts={} ) ## check if name include slash (e.g. /) ## - if not auto-add openfootball/ (default) if name_easy.index( '/' ).nil? name = "openfootball/#{name_easy}" else name = name_easy ## just pass through for now end super( name, opts ) ### check for known datasets; warn: if not known (might be a typo) unless FootballDataset.known_datasets.include?( name ) ## todo: use logger - why, why not?? puts "*** warn: unknown football dataset '#{name}', typo ???" end end |
Class Method Details
.known_datasets ⇒ Object
89 90 91 92 93 94 95 96 |
# File 'lib/datafile/datasets/dataset.rb', line 89 def self.known_datasets ## return array of known datasets ### todo/fix - use \\= idiom - why, why not?? if @@known_football_datasets.nil? @@known_football_datasets = read_known_datasets( "#{::Datafile.data_path}/football.txt" ) end @@known_football_datasets end |
Instance Method Details
#file_worker ⇒ Object
119 |
# File 'lib/datafile/datasets/dataset.rb', line 119 def file_worker() FootballFileDataset.new( self ); end |
#zip_worker ⇒ Object
118 |
# File 'lib/datafile/datasets/dataset.rb', line 118 def zip_worker() FootballZipDataset.new( self ); end |