Project

General

Profile

Bug #15211

Integer.try_convert

Added by nobu (Nobuyoshi Nakada) 2 months ago. Updated 2 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:89301]

Description

I found Integer doesn't have try_convert method, which converts the argument by to_int method without explicit conversions like Integer().
This is useful to treat an Integer-like argument like as methods written in C.

https://github.com/nobu/ruby/tree/feature/Integer.try_convert

History

#1 [ruby-core:89306] Updated by Hanmac (Hans Mackowiak) 2 months ago

I don't know about the other try_convert

how does Ruby react if you try to overwrite the try_convert from the ruby side?

i suspect that currently it doesn't care, should that be changed?

Also available in: Atom PDF