vendor/gems/mechanize-0.9.2/lib/www/mechanize/file.rb
# Use this method to save the content of this object to filename
Use this method to save the content of this object to filename
Use this method to save the content of this object to filename
def save_as(filename = nil)
        if filename.nil?
          filename = @filename
          number = 1
          while(::File.exists?(filename))
            filename = "#{@filename}.#{number}"
            number += 1
          end
        end
        ::File::open(filename, "wb") { |f|
          f.write body
        }
      end
def save_as ( filename = nil ) if filename . nil? filename = @filename number = 1 while ( :: File . exists? ( filename ) ) filename = "#{@filename}.#{number}" number += 1 end end :: File :: open ( filename , "wb" ) { | f | f . write body } end
Use this method to save the content of this object to filename
Use this method to save the content of this object to filename
filename