class DoStuff def initialize instance_eval File.read('config') end def do_stuff (&block) @do_stuff = block end def run_func @do_stuff.call end end a = DoStuff.new a.run_func