Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法从 Open::URI 的 rdoc 中得知我执行此操作时返回的内容:
result = open(url)
URL 返回 XML,但我如何查看/解析 XML?
open返回一个 IO 对象。您可以执行以下操作:
open
xml = open(url).read
请注意,您始终可以通过询问其类来确定某物是什么:
open(url).class # => Tempfile