On 11/16/05, Brian Schröder firstname.lastname@example.org wrote:
I couldn’t find any hint on google though
Maybe you should look at the delegation pattern. That may be
applicable here. But I have not yet understood your use case. Could
you describe it in a bit more detail?
Consider a client script that has to querry a server.
The server operate on users/domains of a running qmail.
So, I would have a class named Client, with the folowing members:
login( user, pass ) logins to the remote administration server
domain an instantion of a domain class.
OTOH Domain class has X member functions:
add( domain_name) adds a new domain
So a scenario would look like:
c =Client.new #creates a new Domain object
c.login( “foo”, “bar” )
c.domain.add( “localdomain” )
Now , back to the code ,the attr_reader was the magic word from what
Pit posted .
Maybe you too observed, but why in ruby
this attr_reader : b is different from attr_reader :b
^space ^no space
Use “Reply to All” on mailing lists.
chmod +x universe