Class: UndriveGoogle::Transformations::Unzip
- Inherits:
-
Object
- Object
- UndriveGoogle::Transformations::Unzip
- Defined in:
- lib/undrive_google/transformations/unzip.rb
Overview
Download a particular version of the file.
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#html_path ⇒ Object
Returns the value of attribute html_path.
Instance Method Summary collapse
-
#initialize(file_path, destination = nil) ⇒ Unzip
constructor
A new instance of Unzip.
-
#process ⇒ Object
Nil.
Constructor Details
#initialize(file_path, destination = nil) ⇒ Unzip
Returns a new instance of Unzip.
9 10 11 12 |
# File 'lib/undrive_google/transformations/unzip.rb', line 9 def initialize(file_path, destination = nil) @file_path = file_path @destination = destination || File.dirname(file_path) end |
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
7 8 9 |
# File 'lib/undrive_google/transformations/unzip.rb', line 7 def destination @destination end |
#file_path ⇒ Object
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_path ⇒ Object
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
#process ⇒ Object
Returns nil.
15 16 17 18 19 20 21 22 23 |
# File 'lib/undrive_google/transformations/unzip.rb', line 15 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 |