Module: Down::Httpx::DownloadedFile

Defined in:
lib/down/httpx.rb

Overview

Defines some additional attributes for the returned Tempfile.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#charsetObject

Returns the value of attribute charset.



169
170
171
# File 'lib/down/httpx.rb', line 169

def charset
  @charset
end

#content_typeObject

Returns the value of attribute content_type.



169
170
171
# File 'lib/down/httpx.rb', line 169

def content_type
  @content_type
end

#headersObject

Returns the value of attribute headers.



169
170
171
# File 'lib/down/httpx.rb', line 169

def headers
  @headers
end

#urlObject

Returns the value of attribute url.



169
170
171
# File 'lib/down/httpx.rb', line 169

def url
  @url
end

Instance Method Details

#original_filenameObject



171
172
173
174
# File 'lib/down/httpx.rb', line 171

def original_filename
  Utils.filename_from_content_disposition(headers["Content-Disposition"]) ||
  Utils.filename_from_path(URI.parse(url).path)
end