Class: WWW::Mechanize::File

Class | WWW::Mechanize::File
In: | lib/www/mechanize/file.rb
Parent: | Object

# Synopsis

This is the default (and base) class for the Pluggable Parsers. If Mechanize cannot find an appropriate class to use for the content type, this class will be used. For example, if you download a JPG, Mechanize will not know how to parse it, so this class will be instantiated.

This is a good class to use as the base class for building your own pluggable parsers.

## Example

     require 'rubygems'
     require 'mechanize'

     agent = WWW::Mechanize.new
     agent.get('http://example.com/foo.jpg').class  #=> WWW::Mechanize::File

### Methods

new save save_as

### External Aliases

response | -> | header
body | -> | content

### Attributes

body | [RW] |
code | [RW] |
filename | [RW] |
response | [RW] |
uri | [RW] |

### Public Class methods

new(uri=nil, response=nil, body=nil, code=nil) {|self if block_given?| ...}

### Public Instance methods

save(filename = nil)

Alias for save_as

save_as(filename = nil)

Use this method to save the content of this object to filename

[Validate]