From: "Iñaki Baz Castillo" Date: 2008-04-25T21:35:35+09:00 Subject: Re: "alias name objetc.method" not allowed? 2008/4/25, David A. Black : > Hi -- > > On Fri, 25 Apr 2008, Iñaki Baz Castillo wrote: > > > > 2008/4/25, David A. Black : > > > > > I think you want: > > > > > > def ob_hello > > > object.hello > > > end > > > > > > > Yes, sure it works (and it that I'm using now), but since in fact is > > no a new method but just an alias I'd prefer using "alias" > > nomenclature... if it would be possible XD > > > > alias creates a new name for an existing method. It's not a > general-purpose named wrapper around arbitrary code. That's what > method definitions are for :-) Well, I've created "pv_reader", "pv_writer" and "pv_accessor": XDD def self.pv_reader(name, method) module_eval %{ def #{name} #{method} end } end def self.pv_writer(name, method) module_eval %{ def #{name}= (value) #{method}=(value) end } end def self.pv_accessor(name, method) self.pv_reader(name, method) self.pv_writer(name, method) end So I use them as the following: pv_accessor :fd :"from.domain" Ruby is great !!! -- Iñaki Baz Castillo