Class: Datafile::ZipPackage::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/sportdb/formats/datafile_package.rb

Instance Method Summary collapse

Constructor Details

#initialize(pack, entry) ⇒ Entry

Returns a new instance of Entry.



74
75
76
77
# File 'lib/sportdb/formats/datafile_package.rb', line 74

def initialize( pack, entry )
  @pack  = pack
  @entry = entry
end

Instance Method Details

#nameObject



79
# File 'lib/sportdb/formats/datafile_package.rb', line 79

def name()  @entry.name; end

#readObject



80
81
82
83
84
85
# File 'lib/sportdb/formats/datafile_package.rb', line 80

def read
  txt = @entry.get_input_stream.read
  ##  puts "** encoding: #{txt.encoding}"  #=> encoding: ASCII-8BIT
  txt = txt.force_encoding( Encoding::UTF_8 )
  txt
end