hello,

require "cgi"
q = CGI.new.query
p q.key  # ==> "value"

How about this?



-----
class CGI
  class Query
    def initialize(params)
      @params = params
    end
    def method_missing(key)
      @params[key.to_s].first
    end
  end
  def query
    CGI::Query.new(@params)
  end
end

cgi = CGI.new
q = cgi.query
p q.key  # ==> "value"


-- 
Wakou Aoyama  <wakou / ruby-lang.org>