I want to write a method (in Ruby/Rails) that takes a URL (String) to a text file and uses JSON to parse it.
# LOAD entity file def load (url) ` result = JSON.parse(x) end
What should x
be? (I know it needs to be either a String or an IO object, but how do I get a string/IO object whose content is the content of the file that url
points to?