Class: Opensaz::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/opensaz/extractor.rb

Instance Method Summary collapse

Constructor Details

#initialize(saz_path) ⇒ Extractor

Returns a new instance of Extractor.



7
8
9
10
11
12
# File 'lib/opensaz/extractor.rb', line 7

def initialize(saz_path)
  # saz_path should be absolute path
  raise "no such file: #{saz_path}" unless File.exist?(saz_path)
  @saz = saz_path
  @md5 = Digest::MD5.hexdigest(File.read(@saz))
end

Instance Method Details

#unzipObject



14
15
16
# File 'lib/opensaz/extractor.rb', line 14

def unzip
  File.exist?(destination) ? destination : Extractor.unzip(@saz, destination)
end