From: james@... Date: 2002-07-10T01:36:44+09:00 Subject: RE: self_parent > class A > def initialize(x) > x.call > end > def display > puts 'hello' > end > end > > class B > def initialize(x) > x.call > end > def display > puts 'goodbye' > end > end > > x = OpenProc { display } > > A.new(x) --> hello > B.new(x) --> goodbye What else would OpenProc do? Why wouldn't you do class ScriptMe def initialize( *x) x.each{ |m| self.send( m ) } end def display puts 'hello' end end x = "display" ScriptMe.new( x ) --> hello Or, class OpenProc attr_reader :proc, :script def initialize( prk, skrpt ) @prok = prk @script = skrpt end end class ScriptMe def initialize( op ) op.script.each{ |m| self.send( m ) } # do something with op.prok if need be ... end def display puts 'hello' end end x = OpenProc( proc{ puts "Hi!"}, "display" } ScriptMe.new( x ) --> hello James