mechanize:Mechanize::Form::SelectList#option_with

MultiSelectList から継承しているようだ

以下のような HTML で

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

<form method="get" action="cgi/foo00.cgi" name="form1">
  <select name="select1">
    <option>1</option>
    <option>2</option>
  </select>
  <select name="select2" multiple>
    <option>foo</option>
    <option>bar</option>
  </select>
</form>

</body>
</html>
>> require 'mechanize'
=> true
>> agent = Mechanize.new
=> #<Mechanize:0xb74ac600 ...
>> page = agent.get('http://127.0.0.1:8080/test20_select.html')
=> #<Mechanize::Page
  ...
>> f = page.form('form1')
=> #<Mechanize::Form
  ...
>> f.fields[0].options
=> [#<Mechanize::Form::Option:0xb749ed34 @select_list=#<Mechanize::Form::SelectList:0xb749f4b4 @options=[...], @name="select1", @value=[], @node=#<Nokogiri::XML::Element:0x..fdba4fa96 name="select" attributes=[#<Nokogiri::XML::Attr:0x..fdba4e268 name="name" value="select1">] children=[#<Nokogiri::XML::Element:0x..fdba4f6b8 name="option" children=[#<Nokogiri::XML::Text:0x..fdba4d520 "1">]>, #<Nokogiri::XML::Element:0x..fdba4f6ae name="option" children=[#<Nokogiri::XML::Text:0x..fdba4cd5a "2">]>]>>, @selected=false, @text="1", @value="1">, #<Mechanize::Form::Option:0xb749ec80 @select_list=#<Mechanize::Form::SelectList:0xb749f4b4 @options=[...], @name="select1", @value=[], @node=#<Nokogiri::XML::Element:0x..fdba4fa96 name="select" attributes=[#<Nokogiri::XML::Attr:0x..fdba4e268 name="name" value="select1">] children=[#<Nokogiri::XML::Element:0x..fdba4f6b8 name="option" children=[#<Nokogiri::XML::Text:0x..fdba4d520 "1">]>, #<Nokogiri::XML::Element:0x..fdba4f6ae name="option" children=[#<Nokogiri::XML::Text:0x..fdba4cd5a "2">]>]>>, @selected=false, @text="2", @value="2">]
>> f.fields[0].option_with(:value => //).value
=> "1"
>> f.fields[0].option_with(:value => /2/).value
=> "2"