Class: Jobler::FileDownload

Inherits:
Object
  • Object
show all
Defined in:
lib/jobler/file_download.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name: nil, temp_file: nil, url: nil) ⇒ FileDownload

Returns a new instance of FileDownload.



4
5
6
7
8
9
10
11
# File 'lib/jobler/file_download.rb', line 4

def initialize(file_name: nil, temp_file: nil, url: nil)
  raise "Temp file or URL should be given" if !temp_file && !url
  raise "No filename given with temp-file" if temp_file && file_name.blank?

  @file_name = file_name
  @temp_file = temp_file
  @url = url
end

Instance Attribute Details

#file_nameObject (readonly)

Returns the value of attribute file_name.



2
3
4
# File 'lib/jobler/file_download.rb', line 2

def file_name
  @file_name
end

#temp_fileObject (readonly)

Returns the value of attribute temp_file.



2
3
4
# File 'lib/jobler/file_download.rb', line 2

def temp_file
  @temp_file
end

#urlObject (readonly)

Returns the value of attribute url.



2
3
4
# File 'lib/jobler/file_download.rb', line 2

def url
  @url
end