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.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/datafile/datasets/dataset.rb', line 74 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
64 65 66 67 68 69 70 71 |
# File 'lib/datafile/datasets/dataset.rb', line 64 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
94 |
# File 'lib/datafile/datasets/dataset.rb', line 94 def file_worker() FootballFileDataset.new( self ); end |
#zip_worker ⇒ Object
93 |
# File 'lib/datafile/datasets/dataset.rb', line 93 def zip_worker() FootballZipDataset.new( self ); end |