Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Forked from nkpart/gist:1538
Created July 23, 2008 05:14
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save benhoskings/1540 to your computer and use it in GitHub Desktop.
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