Skip to content

Instantly share code, notes, and snippets.

@korny
Created January 8, 2014 19:05
Show Gist options
  • Save korny/8322428 to your computer and use it in GitHub Desktop.
Save korny/8322428 to your computer and use it in GitHub Desktop.
block_given? doesn't work in a delegating BasicObject
class Foo < BasicObject
def test_block_given?
block_given?
end
private
def method_missing(method, *args, &block)
3.send(method, *args, &block)
end
end
Foo.new.test_block_given? {} # => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment