mechanize:Mechanize::Form::Field#name

以下のような HTML で

<html>
<head>
<title>form test</title>
</head>
<body>

<form method="get" action="cgi/foo00.cgi" name="form1">
  <input type="text" name="text1" />
  <input type="hidden" name="hidden1" />
  <textarea name="textarea1" rows="4" cols="40">foo</textarea>
</form>

</body>
</html>
>> require 'mechanize'
=> true
>> agent = Mechanize.new
=> #<Mechanize:0xb7455594 ...
>> page = agent.get('http://127.0.0.1:8080/test10_form.html')
=> #<Mechanize::Page
  ...
>> f = page.form('form1')
=> #<Mechanize::Form
  ...
>> f.field_with(:name => /text/).name
=> "text1"
>> f.fields_with(:name => /text/).each  {|x| p [x.class, x.name] }
[Mechanize::Form::Text, "text1"]
[Mechanize::Form::Field, "textarea1"]
=> [#<Mechanize::Form::Text:0xb7449258 @name="text1", @value="", @node=#<Nokogiri::XML::Element:0x..fdba249fe name="input" attributes=[#<Nokogiri::XML::Attr:0x..fdba23004 name="type" value="text">, #<Nokogiri::XML::Attr:0x..fdba22ffa name="name" value="text1">]>>, #<Mechanize::Form::Field:0xb7448920 @name="textarea1", @value="foo", @node=#<Nokogiri::XML::Element:0x..fdba244cc name="textarea" attributes=[#<Nokogiri::XML::Attr:0x..fdba2066a name="name" value="textarea1">, #<Nokogiri::XML::Attr:0x..fdba20660 name="rows" value="4">, #<Nokogiri::XML::Attr:0x..fdba20656 name="cols" value="40">] children=[#<Nokogiri::XML::Text:0x..fdba1f4b8 "foo">]>>]