Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created September 26, 2008 22:11
Show Gist options
  • Save ELLIOTTCABLE/13215 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/13215 to your computer and use it in GitHub Desktop.
class Nothing
def self.bar &block
p block
end
bar_as_block = method(:bar).to_proc
self.send :define_method, :bar_two, &bar_as_block
end
foo = lambda {p 'test'}
nothing = Nothing.new
Nothing.bar &foo
nothing.bar_two &foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment