How does the standard library allow you to coerce a String into an Integer with Integer('1') #=> 1? Is there a language feature that allows one to create this kind of conversion syntax in a class?
String
Integer
Integer('1') #=> 1
Aucun commentaire:
Enregistrer un commentaire