Skip to content

Enumerable::Argumentable broken for .min and .max 🐛 #161

@anithri

Description

@anithri

The implementation of Enumerable::Argumentable is broken for methods with an .arity of -1 such as .min and .max

In both cases the method has a variable number of arguments which makes it .arity = -1. Given the way Argumentable works for arity -1 the method always passes the single argument to the min method, and passes nothing to the each resulting it taking the X smallest values of the given and unchanged array

The offending code is here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions