Class: Jobler::FileDownload
- Inherits:
-
Object
- Object
- Jobler::FileDownload
- Defined in:
- lib/jobler/file_download.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#temp_file ⇒ Object
readonly
Returns the value of attribute temp_file.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(file_name: nil, temp_file: nil, url: nil) ⇒ FileDownload
constructor
A new instance of FileDownload.
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_name ⇒ Object (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_file ⇒ Object (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 |
#url ⇒ Object (readonly)
Returns the value of attribute url.
2 3 4 |
# File 'lib/jobler/file_download.rb', line 2 def url @url end |