Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Forked from nkpart/gist:1538
Created July 23, 2008 05:14
class Object
def new_with &block
self.new.instance_eval {
yield
}
end
end
$logger = Object.new_with {
define_method :foo do
"bar"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment