From: Trans Date: 2008-03-23T21:05:30+09:00 Subject: Re: #meta On Mar 23, 7:19 am, Robert Klemme wrote: > So then the only (?) advantage of your proposal is that you can use > private methods like ordinary methods. > > > There's no need for meta at all, you could just use "class << self" > > directly, Well, yea. Wait a minute... could we set the methods we're interested in here to protected instead of private? And, as you suggest, just use the singleton class? >> def singleton >> class<> end => nil >> class Module >> protected :attr_accessor >> end => Module >> class X >> singleton.attr_accessor :x >> end => nil >> X.x => nil >> X.attr_accessor :y NoMethodError: protected method `attr_accessor' called for X:Class from (irb):11 Looks good!!! Not sure why this never occurred to me before. See anything wrong with this approach? T.