build_query (WWW::Mechanize::Form)

    # File lib/www/mechanize/form.rb, line 162
          def build_query(buttons = [])
            query = []

            fields().each do |f|
              qval = proc_query(f)
              query.push(*qval)
            end

            checkboxes().each do |f|
              if f.checked
                qval = proc_query(f)
                query.push(*qval)
              end
            end

            radio_groups = {}
            radiobuttons().each do |f|
              fname = from_native_charset(f.name)
              radio_groups[fname] ||= []
              radio_groups[fname] << f
            end

            # take one radio button from each group
            radio_groups.each_value do |g|
              checked = g.select {|f| f.checked}

              if checked.size == 1
                f = checked.first
                qval = proc_query(f)
                query.push(*qval)
              elsif checked.size > 1
                raise "multiple radiobuttons are checked in the same group!"
              end
            end

            @clicked_buttons.each { |b|
              qval = proc_query(b)
              query.push(*qval)
            }
            query
          end