class TextFile < Mechanize::File def title; @body.to_a[0]; end # 適当に1行目をタイトルにする end agent.pluggable_parser['text/plain'] = TextFileとすると、
agent.pluggable_parser.default = Mechanize::FileSaverとすると、
# CSV ファイル用のクラスをnew agent.pluggable_parser['text/csv'].new該当するものが登録されていなければ nil を返します。
agent.pluggable_parser[content_type] = klassのようになることでしょう。