Skip to content

Instantly share code, notes, and snippets.

@raws
Created April 15, 2010 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raws/367780 to your computer and use it in GitHub Desktop.
Save raws/367780 to your computer and use it in GitHub Desktop.
>> class C
>> def initialize(foo, bar)
>> puts foo.inspect
>> puts bar.inspect
>> end
>> end
=> nil
>> C.method(:initialize).arity
=> -1
>> C.method(:new).arity
=> -1
>> C.new(:foo, :bar)
:foo
:bar
=> #<C:0x1005b6a20>
>> C.new
ArgumentError: wrong number of arguments (0 for 2)
from (irb):25:in `initialize'
from (irb):25:in `new'
from (irb):25
from :0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment