Class: Opensaz::Extractor
- Inherits:
-
Object
- Object
- Opensaz::Extractor
- Defined in:
- lib/opensaz/extractor.rb
Instance Method Summary collapse
-
#initialize(saz_path) ⇒ Extractor
constructor
A new instance of Extractor.
- #unzip ⇒ Object
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
#unzip ⇒ Object
14 15 16 |
# File 'lib/opensaz/extractor.rb', line 14 def unzip File.exist?(destination) ? destination : Extractor.unzip(@saz, destination) end |