Sha256: ad87d11213eaa8e2c615b41aea863ac30c8530541a6633369474f927092e85c3

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

class Mechanize
  class Form
    # This class represents a file upload field found in a form.  To use this
    # class, set WWW::FileUpload#file_data= to the data of the file you want
    # to upload and WWW::FileUpload#mime_type= to the appropriate mime type
    # of the file.
    # See the example in EXAMPLES[link://files/EXAMPLES_txt.html]
    class FileUpload < Field
      attr_accessor :file_name # File name
      attr_accessor :mime_type # Mime Type (Optional)

      alias :file_data :value
      alias :file_data= :value=

        def initialize(name, file_name)
          @file_name = Util.html_unescape(file_name)
          @file_data = nil
          super(name, @file_data)
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
kitamomonga-mechanize-0.9.3.20090724215219 lib/mechanize/form/file_upload.rb
tenderlove-mechanize-0.9.3.20090911221705 lib/mechanize/form/file_upload.rb