Actions
Feature #15211
closedInteger.try_convert
    Feature #15211:
    Integer.try_convert
  
Status:
Closed
Assignee:
-
Target version:
-
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
        
           Updated by Hanmac (Hans Mackowiak) about 7 years ago
          Updated by Hanmac (Hans Mackowiak) about 7 years 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?
        
           Updated by jeremyevans0 (Jeremy Evans) about 6 years ago
          Updated by jeremyevans0 (Jeremy Evans) about 6 years ago
          
          
        
        
      
      - Tracker changed from Bug to Feature
- Backport deleted (2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN)
        
           Updated by nobu (Nobuyoshi Nakada) over 4 years ago
          Updated by nobu (Nobuyoshi Nakada) over 4 years ago
          
          
        
        
      
      - Status changed from Open to Closed
Applied in changeset git|301d194ee3b49e6b078eccb999dd538e9bfa8c7c.
Add Integer.try_convert [Feature #15211]
Actions