Class: SportDb::LeagueReader

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging, Model
Defined in:
lib/sportdb/readers/league.rb

Constant Summary

Constants included from Model

Model::City, Model::Continent, Model::Country, Model::Prop, Model::Region

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(include_path, opts = {}) ⇒ LeagueReader

Returns a new instance of LeagueReader.



17
18
19
# File 'lib/sportdb/readers/league.rb', line 17

def initialize( include_path, opts = {} )
  @include_path = include_path
end

Instance Attribute Details

#include_pathObject (readonly)

Returns the value of attribute include_path.



14
15
16
# File 'lib/sportdb/readers/league.rb', line 14

def include_path
  @include_path
end

Instance Method Details

#read(name, more_attribs = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/sportdb/readers/league.rb', line 22

def read( name, more_attribs={} )
  reader = ValuesReaderV2.new( name, include_path, more_attribs )

  reader.each_line do |new_attributes, values|
    League.create_or_update_from_values( new_attributes, values )
  end # each lines
end