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.

3 Responses to “TheInternet.is_a?(Hash) == true”

  1. Mr. Neighborly Says:

    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.

  2. Peter Krantz Says:

    Neat trick! Looks like an easy way to interact with REST interfaces.

  3. Benjamin Says:

    The secrets of the internet are out of the bag now… unless TheInternet.exist? == nil

Leave a Reply

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(4) (1) (1) (1) (1) (2) (1) (1) (1) (2) (2) (1) (2) (1) (3) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (4) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (1) (3) (1) (5) (2) (10) (10) (11) (14) (2) (1) (3) (1) (1) (1) (1) (1) (0) (1) (2) (2) (2) (1) (1) (1) (4) (1) (3) (1) (4) (2) (2) (25) (2) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (1) (4) (5) (1) (1) (1) (4) (1) (2) (3) (4) (4) (1) (1) (1) (8) (3) (1) (5) (5) (2) (2) (2) (4) (8) (7) (1) (1) (1) (1) (2) (4) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives