Fraction.st
changeset 21819 c62073747a0a
parent 21766 4974e66281d4
child 21942 73cd95d3f948
--- a/Fraction.st	Thu Jun 15 13:57:09 2017 +0200
+++ b/Fraction.st	Thu Jun 15 13:57:20 2017 +0200
@@ -237,6 +237,14 @@
     ]
 ! !
 
+!Fraction class methodsFor:'coercing & converting'!
+
+coerce:aNumber
+    "convert the argument aNumber into an instance of the receiver's class and return it."
+
+    ^ aNumber asFraction
+! !
+
 !Fraction class methodsFor:'constants'!
 
 pi