Skip to content

Instantly share code, notes, and snippets.

@chrishunt
Last active December 14, 2015 13:58
Show Gist options
  • Save chrishunt/5096918 to your computer and use it in GitHub Desktop.
Save chrishunt/5096918 to your computer and use it in GitHub Desktop.
def foo(x, y); end
def bar(x, y = 2); end
def baz(x = 1, y = 2); end
method(:foo).arity #=> 2
method(:bar).arity #=> -2
method(:baz).arity #=> -1
def buz(x, y: 2); end
def pat(x: 1, y: 2); end
method(:buz).arity #=> 1 (shouldn't this be -2 ?)
method(:pat).arity #=> 0 (shouldn't this be -1 ?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment