Class: SportDb::TeamReader

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging, Model
Defined in:
lib/sportdb/readers/team.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 = {}) ⇒ TeamReader

Returns a new instance of TeamReader.



18
19
20
# File 'lib/sportdb/readers/team.rb', line 18

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

Instance Attribute Details

#include_pathObject (readonly)

Returns the value of attribute include_path.



15
16
17
# File 'lib/sportdb/readers/team.rb', line 15

def include_path
  @include_path
end

Instance Method Details

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



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

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

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