Class: CarrierWave::Uploader::Download::RemoteFile

Inherits:
Object
  • Object
show all
Defined in:
lib/carrierwave/uploader/download.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ RemoteFile

Returns a new instance of RemoteFile.



14
15
16
# File 'lib/carrierwave/uploader/download.rb', line 14

def initialize(uri)
  @uri = URI.parse(uri)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (private)



36
37
38
# File 'lib/carrierwave/uploader/download.rb', line 36

def method_missing(*args, &block)
  file.send(*args, &block)
end

Instance Method Details

#http?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/carrierwave/uploader/download.rb', line 26

def http?
  @uri.scheme =~ /^https?$/
end

#original_filenameObject



18
19
20
# File 'lib/carrierwave/uploader/download.rb', line 18

def original_filename
  File.basename(@uri.path)
end

#respond_to?(*args) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/carrierwave/uploader/download.rb', line 22

def respond_to?(*args)
  super or file.respond_to?(*args)
end