Class: UndriveGoogle::Transformations::Download

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

Overview

Download a particular version of the file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, extension) ⇒ Download

Returns a new instance of Download.



9
10
11
12
13
# File 'lib/undrive_google/transformations/download.rb', line 9

def initialize(file_path, extension)
  @extension = extension
  @file = Session.instance.file
  @file_path = file_path
end

Instance Attribute Details

#extensionObject

Returns the value of attribute extension.



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

def extension
  @extension
end

#fileObject

Returns the value of attribute file.



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

def file
  @file
end

#file_pathObject

Returns the value of attribute file_path.



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

def file_path
  @file_path
end

Instance Method Details

#processObject

Returns nil.

Returns:

  • nil



16
17
18
19
20
21
# File 'lib/undrive_google/transformations/download.rb', line 16

def process
  puts "Downloading #{file.title} as: #{extension} to: #{file_path}" if Options.instance.verbose
  file.export_as_file(file_path, extension)

  nil
end