[Nikolai Weibull <mailing-lists.ruby-talk / rawuncut.elitemail.org>, 2005-05-17 15.52 CEST]
> Id like to have a def that I can scope in one go, i.e.,
> 
> class A
>   scoped_def :private, :a do
>     
>   end
> end
> 
> at least until we get decorators in Ruby.  The following seems to work:
[...]

How about something like this? It's closer to the current usage:

class Class
	def method_added m
		if @decorator
			send(@decorator, m)
		end
		@decorator = nil
	end
	
	def priv
		@decorator = :private
	end
end

class C
	priv; def a() puts "private" end
	def b() puts "public" end
end

c = C.new
c.b
c.a