Skip to content

Instantly share code, notes, and snippets.

@cho45
Created December 29, 2015 09:17
Show Gist options
  • Save cho45/8d6ce35fd65b40e92d5b to your computer and use it in GitHub Desktop.
Save cho45/8d6ce35fd65b40e92d5b to your computer and use it in GitHub Desktop.
class Foo
def to_a
[:to_a, :to_a]
end
def to_ary
[:to_ary, :to_ary]
end
end
a, b, c = *Foo.new
p [a, b, c]
a, b, c = Foo.new
p [a, b, c]
# ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
# [:to_a, :to_a, nil]
# [:to_ary, :to_ary, nil]
# mruby --version
# mruby 1.2.0 (2015-11-17)
# [:to_a, :to_a, nil]
# [#<Foo:0x7fd711804a40>, nil, nil]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment