Network Facade API

June 8, 2007 — Leave a comment

I was looking at the NetworkFacade api, (check it out at network-facade.rubyforge.org) and noticed:

1
2
3
  # Or declate the Foo class and set an uri
  class Foo < NetworkFacade::Client 'nf://localhost:5042'
  end

where the uri is defined with the Foo declaration. Foo descends from the class returned by the Client class method.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module NetworkFacade

    def self.Client(uri = nil)
        TCP::Client.uri = uri
        TCP::Client
    end

    class Client < TCP::Client
    end


    class Server < TCP::Server
    end

end

That is cool.

No Comments

Be the first to start the conversation!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s