Sha256: 2a8f1b72fb046433d49772923348e27b8d55313c388134585b728cc07c19b4ef

Contents?: true

Size: 720 Bytes

Versions: 15

Compression:

Stored size: 720 Bytes

Contents

module WWW
  class Mechanize
    class Form
      # This class represents a field in a form.  It handles the following input
      # tags found in a form:
      # text, password, hidden, int, textarea
      #
      # To set the value of a field, just use the value method:
      # field.value = "foo"
      class Field
        attr_accessor :name, :value
      
        def initialize(name, value)
          @name = Util.html_unescape(name)
          @value = if value.is_a? String
                     Util.html_unescape(value)
                   else
                     value
                   end
        end
      
        def query_value
          [[@name, @value || '']]
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 5 rubygems

Version Path
eric-mechanize-0.9.3.20090623142847 lib/www/mechanize/form/field.rb
knu-mechanize-0.9.3.20090623142847 lib/www/mechanize/form/field.rb
tenderlove-mechanize-0.9.3.20090617085936 lib/www/mechanize/form/field.rb
tenderlove-mechanize-0.9.3.20090623142847 lib/www/mechanize/form/field.rb
mechanize-ntlm-0.9.1 lib/www/mechanize/form/field.rb
mechanize-0.8.0 lib/www/mechanize/form/field.rb
mechanize-0.8.1 lib/www/mechanize/form/field.rb
mechanize-0.8.3 lib/www/mechanize/form/field.rb
mechanize-0.8.4 lib/www/mechanize/form/field.rb
mechanize-0.8.2 lib/www/mechanize/form/field.rb
mechanize-0.8.5 lib/www/mechanize/form/field.rb
mechanize-0.9.2 lib/www/mechanize/form/field.rb
mechanize-0.9.3 lib/www/mechanize/form/field.rb
mechanize-0.9.0 lib/www/mechanize/form/field.rb
mechanize-0.9.1 lib/www/mechanize/form/field.rb