Parent

Class Index [+]

Quicksearch

Mechanize::Form::Field

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“

Attributes

name[RW]
value[RW]
node[RW]

Public Class Methods

new(node, value = node['value']) click to toggle source
    # File lib/mechanize/form/field.rb, line 12
12:       def initialize node, value = node['value']
13:         @node = node
14:         @name = Util.html_unescape(node['name'])
15:         @value = if value.is_a? String
16:                    Util.html_unescape(value)
17:                  else
18:                    value
19:                  end
20:       end

Public Instance Methods

<=>(other) click to toggle source
    # File lib/mechanize/form/field.rb, line 26
26:       def <=> other
27:         return 0 if self == other
28:         return 1 if Hash === node
29:         return 1 if Hash === other.node
30:         node <=> other.node
31:       end
query_value() click to toggle source
    # File lib/mechanize/form/field.rb, line 22
22:       def query_value
23:         [[@name, @value || '']]
24:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.