From: boris@... Date: 2014-02-22T07:02:45+00:00 Subject: [ruby-core:60995] [ruby-trunk - Feature #9553] [Open] Make argument validation routine of a method an object Issue #9553 has been reported by Boris Stitnicky. ---------------------------------------- Feature #9553: Make argument validation routine of a method an object https://bugs.ruby-lang.org/issues/9553 * Author: Boris Stitnicky * Status: Open * Priority: Normal * Assignee: * Category: * Target version: ---------------------------------------- Ruby methods have their acceptable argument configurations specified by special syntax. As argument fields has gotten more complex, simple `#arity` is no longer enough to capture the type of the argument field. I suggest making this argument validation routine (so far defined by special syntax) introspectible, and reusable for the purposes of metaprogramming. One possibility would be to have eg. `ArgumentValidator` and/or `UnboundArgumentValidator` objects just like we have method and unbound method objects. Then eg. `Method#argity` / `Proc#argity` would return that `ArgumentValidator` or `UnboundArgumentValidator`. The purpose of this post is not to suggest the final solution, but to bring attention to the problem of non-oo nature of built-in argument validation and the growing need to do something about that. -- http://bugs.ruby-lang.org/