0

我正在尝试将以下行传递给 find 方法

query = "?name=#{CGI.escape(name)}&limit=#{limit}#{offset}"


def find(opts = {},limit,offset)

      if opts[:query].nil? || opts[:query].empty?
        return Net::HTTPNotFound
      end
      path = '/'
      if opts[:query]
      path << "?#{opts[:query]}"
      path << "&limit=#{limit}" 
      path << "&offset=#{offset}" 

当我执行 opts [:query] 时,我似乎无法将 Symbol 转换为 Integer。我怎样才能解决这个问题?

4

1 回答 1

0

The method assumes that opts is a Hash when it's really a String

One way of fixing is to call the query_account method like:

response = query_account({:query => query},limit,offset)

Or change the method to work with query directly.

于 2013-03-15T19:29:45.757 回答