Method: Mechanize::Form::SelectList#initialize

Defined in:
lib/mechanize/form/select_list.rb

#initialize(node) ⇒ SelectList

Returns a new instance of SelectList.

[View source]

12
13
14
15
16
17
18
19
# File 'lib/mechanize/form/select_list.rb', line 12

def initialize node
  super
  if selected_options.length > 1
    selected_options.reverse[1..selected_options.length].each do |o|
      o.unselect
    end
  end
end