Created
May 14, 2010 00:28
-
-
Save harukizaemon/400667 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def to_ary | |
| ["A", "B", "C", "D"] | |
| end | |
| end | |
| def func(&block) | |
| yield(Foo.new) | |
| end | |
| func do |a, b, *c| | |
| puts a.inspect # MRI => "A" RBX => <#Foo> | |
| puts b.inspect # MRI => "B" RBX => nil | |
| puts c.inspect # MRI => ["C", "D"] RBX => [] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment