Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created April 6, 2012 00:09
Show Gist options
  • Select an option

  • Save practicingruby/2315320 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/2315320 to your computer and use it in GitHub Desktop.
>> class A
>> def initialize(&block)
>> block.call
>> end
>> def foo
>> puts "hi"
>> end
>> end
=> nil
>> A.new { foo }
NameError: undefined local variable or method `foo' for main:Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment