vendredi 8 mai 2015

How is it that you can do `Integer('1')` in Ruby?

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?

Aucun commentaire:

Enregistrer un commentaire