class Datafile::DirPackage::Entry

Public Class Methods

new( pack, path ) click to toggle source
# File lib/sportdb/formats/datafile_package.rb, line 23
def initialize( pack, path )
  @pack = pack  ## parent package
  @path = path
  ## note: calculate name (cut-off pack.path!!!), that is, make path relative (to pack)
  ##   e.g.
  ##    ../../../openfootball/austria/2011-12/1-bundesliga-i.txt
  ##      becomes =>                  2011-12/1-bundesliga-i.txt
  @name = path[ pack.path.length+1..-1 ]
end

Public Instance Methods

name() click to toggle source
# File lib/sportdb/formats/datafile_package.rb, line 32
def name()  @name; end
read() click to toggle source
# File lib/sportdb/formats/datafile_package.rb, line 33
def read()  File.open( @path, 'r:utf-8' ) {|f| f.read }; end