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.



176
177
178
# File 'lib/down/httpx.rb', line 176

def charset
  @charset
end

#content_typeObject

Returns the value of attribute content_type.



176
177
178
# File 'lib/down/httpx.rb', line 176

def content_type
  @content_type
end

#headersObject

Returns the value of attribute headers.



176
177
178
# File 'lib/down/httpx.rb', line 176

def headers
  @headers
end

#urlObject

Returns the value of attribute url.



176
177
178
# File 'lib/down/httpx.rb', line 176

def url
  @url
end

Instance Method Details

#original_filenameObject



178
179
180
181
# File 'lib/down/httpx.rb', line 178

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