Class Mechanize::Download
In: lib/mechanize/download.rb
Parent: Object

Download is a pluggable parser for downloading files without loading them into memory first. You may subclass this class to handle content types you do not wish to load into memory first.

See Mechanize::PluggableParser for instructions on using this class.

Methods

body   new   save  

Included Modules

Mechanize::Parser

External Aliases

body_io -> content

Attributes

body_io  [R]  Accessor for the IO-like that contains the body
filename  [RW]  The filename for this file based on the content-disposition of the response or the basename of the URL

Public Class methods

Creates a new download retrieved from the given uri and response object. The body_io is an IO-like containing the HTTP response body and code is the HTTP status.

Public Instance methods

The body of this response as a String.

Take care, this may use lots of memory if the response body is large.

Saves a copy of the body_io to filename

[Validate]