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.



167
168
169
# File 'lib/down/httpx.rb', line 167

def charset
  @charset
end

#content_typeObject

Returns the value of attribute content_type.



167
168
169
# File 'lib/down/httpx.rb', line 167

def content_type
  @content_type
end

#headersObject

Returns the value of attribute headers.



167
168
169
# File 'lib/down/httpx.rb', line 167

def headers
  @headers
end

#urlObject

Returns the value of attribute url.



167
168
169
# File 'lib/down/httpx.rb', line 167

def url
  @url
end

Instance Method Details

#original_filenameObject



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

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