TheInternet.is_a?(Hash) == true
August 14th, 2006
While convalescing from a recent surgery, I had a flash of insight. One can view the Internet and a file system as one big, really big, Hash.
What is a Hash if not a way to access a value referenced by a key ?
What is a filename ? A key.
What is a URL ? A key.
The above allows us to do very interesting things:
Is this rambling interesting ? Certainly. Is it useful ? You tell me !
DISCLAIMER: The Filesystem object above is full of security holes. It should be implemented in a chrooted, environment, check permissions, etc.
October 12th, 2007 at 10:25 PM
Certainly interesting; I’ve always seen filenames/URLs closer to the concepts of variables (i.e. the variable is merely a label which points to another universally accessible resource which lives within a larger context). But I think both thought processes work. :)
Interesting class implementation, though. It would be interesting to see a lot of classes like this (i.e. classes that implement content specific methods for accessing resources). RSS classes that parse the RSS and present it as a hash or something I don’t know, but it would be cool.
October 12th, 2007 at 10:25 PM
Neat trick! Looks like an easy way to interact with REST interfaces.
October 12th, 2007 at 10:25 PM
The secrets of the internet are out of the bag now… unless TheInternet.exist? == nil