Class: UndriveGoogle::Transformations::Unzip

Inherits:
Object
  • Object
show all
Defined in:
lib/undrive_google/transformations/unzip.rb

Overview

Download a particular version of the file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Unzip

Returns a new instance of Unzip.



9
10
11
# File 'lib/undrive_google/transformations/unzip.rb', line 9

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject

Returns the value of attribute file_path.



7
8
9
# File 'lib/undrive_google/transformations/unzip.rb', line 7

def file_path
  @file_path
end

#html_pathObject

Returns the value of attribute html_path.



7
8
9
# File 'lib/undrive_google/transformations/unzip.rb', line 7

def html_path
  @html_path
end

Instance Method Details

#processObject

Returns nil.

Returns:

  • nil



14
15
16
17
18
19
20
21
22
# File 'lib/undrive_google/transformations/unzip.rb', line 14

def process
  return unless Options.instance.unzip

  puts "Unzipping #{file_path}" if Options.instance.verbose
  extract_zip(file_path, destination)
  puts "Unzipped #{file_path} to #{html_path}" if Options.instance.verbose

  nil
end