I tested the idea with whole numbers, and it doesn't fail. I tested the idea with dates not in the extremes, and it DOES fail. Attached 2 examples. The first one using numbers: ``` (..0) === 0 ``` Which works fine both i...jgomo3 (Jesús Gómez)
The documentation says > OptionParser comes with a few ready-to-use kinds of type coercion. They are > ... But when I try to use the class `URI` as a coercion class: ``` op = OptionParser.new op.on("--uri URI", URI) ``` I g...jgomo3 (Jesús Gómez)
Hanmac (Hans Mackowiak) wrote in #note-8: > @jgomo3 i found my old Symbol#call code > ... Great helper. Well, that is another way. So yes, the whole point of this ticket is to propose to allow that kind of expressions. In other words,...jgomo3 (Jesús Gómez)
Hanmac (Hans Mackowiak) wrote in #note-5: > i tried `ary.map.with_object(:id,&:dig)` but it just returned `:id` > ... Amazing this approach. Sadly, it will work only for Arity-1 functions. If you want to dig more, how to do it? e.g, su...jgomo3 (Jesús Gómez)
sawa (Tsuyoshi Sawada) wrote in #note-4: > I already know that. That does not make `ary.map(:dig.to_proc(:id))` work. You seemed to have missed my point. Ok, it would be actually `ary.map(&:dig.to_proc(:id))`. But that is not the impor...jgomo3 (Jesús Gómez)
> I am not sure how allowing parameters to Symbol#to_proc and Method#to_proc would make: > ... Currently, **to_proc** on symbols creates a **Proc** that receives an object and calls on it the method with name equal to the symbol. The id...jgomo3 (Jesús Gómez)
Allow parameters to Symbol#to_proc and Method#to_proc So we can say: ``` ruby ary.map(:dig.to_proc(:id)) ``` Instead of ``` ruby ary.map { |e| e.dig(:id) } ``` Oppening the posibilities to refine the `&` operator i...jgomo3 (Jesús Gómez)