Class | Mechanize::FileSaver |
In: |
lib/mechanize/file_saver.rb
|
Parent: | Mechanize::Download |
This is a pluggable parser that automatically saves every file it encounters. Unlike Mechanize::DirectorySaver, the file saver saves the responses as a tree, reflecting the host and file path.
This example saves all .pdf files
require 'mechanize' agent = Mechanize.new agent.pluggable_parser.pdf = Mechanize::FileSaver agent.get 'http://example.com/foo.pdf' Dir['example.com/*'] # => foo.pdf
save | -> | save_as |
The save_as alias is provided for backwards compatibility with mechanize 2.0. It will be removed in mechanize 3. |
filename | [R] |