Module: Down::Wget::DownloadedFile

Defined in:
lib/down/wget.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



199
200
201
# File 'lib/down/wget.rb', line 199

def headers
  @headers
end

#urlObject

Returns the value of attribute url.



199
200
201
# File 'lib/down/wget.rb', line 199

def url
  @url
end

Instance Method Details

#charsetObject



209
210
211
# File 'lib/down/wget.rb', line 209

def charset
  headers["Content-Type"].to_s[/;\s*charset=([^;]+)/i, 1]
end

#content_typeObject



205
206
207
# File 'lib/down/wget.rb', line 205

def content_type
  headers["Content-Type"].to_s.split(";").first
end

#original_filenameObject



201
202
203
# File 'lib/down/wget.rb', line 201

def original_filename
  filename_from_content_disposition || filename_from_url
end