Skip to content

Instantly share code, notes, and snippets.

@krekoten
Created December 20, 2010 18:46
Show Gist options
  • Select an option

  • Save krekoten/748801 to your computer and use it in GitHub Desktop.

Select an option

Save krekoten/748801 to your computer and use it in GitHub Desktop.
Very interesting ruby 1.9 behavior
# Ruby 1.9.2
ruby-1.9.2-p0 > class O; end
nil
ruby-1.9.2-p0 > O.new(1,2,3)
#<O:0x00000100a9fcf8>
# Ruby 1.8.7
irb(main):001:0> class O; end
nil
irb(main):002:0> O.new(1,2,3)
ArgumentError: wrong number of arguments (3 for 0)
from (irb):2:in `initialize'
from (irb):2:in `new'
from (irb):2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment