Class: Keynote::Extractor::ArchiveExtractor

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

Class Method Summary collapse

Class Method Details

.extract(file) ⇒ Object



7
8
9
# File 'lib/keynote/extractor/archive_extractor.rb', line 7

def self.extract(file)
  archive = Zip::File.open(file) 
end

.return_files(file) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/keynote/extractor/archive_extractor.rb', line 11

def self.return_files(file)
  archive = extract(file)

  iwa_files = []
  archive.each do |item|
    if item.name == 'index.apxl'
      return item.get_input_stream.read
    end
    iwa_files << item.get_input_stream.read if item.name.split('.').last == 'iwa'
  end
  
  iwa_files
end