jpw
jpw

Reputation: 19247

What is returned by Open::URI.open?

I cannot tell from the rdoc for Open::URI what is returned when I do:

result = open(url)

The URL returns XML, but how do I see/parse the XML?

Upvotes: 3

Views: 2933

Answers (1)

cam
cam

Reputation: 14222

open returns an IO object. You can do something like:

xml = open(url).read

Note you can always determine what something is by asking for its class:

open(url).class  # => Tempfile

Upvotes: 5

Related Questions