DevHeads.net

Postings by Colin Bartlett

I'm confused about Ruby.2.5.3 Method#arity for Dir.entries and Dir#entries

Returns an indication of the number of arguments accepted by a method.
Returns a nonnegative integer for methods that take a fixed number of arguments.
For Ruby methods that take a variable number of arguments,
returns -n-1, where n is the number of required arguments. ...

In the following:
1. Why isn't MRI Dir.method(:entries).arity == 1?
2. Why isn't JRuby Dir.method(:entries).arity == -2?
3. Why isn't MRI d.method(:entries).arity == 0?