module Down::Wget::DownloadedFile

Adds additional attributes to the Tempfile returned in download.

Attributes

headers[RW]
url[RW]

Public Instance Methods

charset() click to toggle source
# File lib/down/wget.rb, line 243
def charset
  headers["Content-Type"].to_s[/;\s*charset=([^;]+)/i, 1]
end
content_type() click to toggle source
# File lib/down/wget.rb, line 239
def content_type
  headers["Content-Type"].to_s.split(";").first
end
original_filename() click to toggle source
# File lib/down/wget.rb, line 234
def original_filename
  Utils.filename_from_content_disposition(headers["Content-Disposition"]) ||
  Utils.filename_from_path(URI.parse(url).path)
end