compile: clean class PrimitiveInfo
[nit.git] / tests / example_time.nit
index f8825b0..9c47159 100644 (file)
@@ -20,7 +20,7 @@
 # The Time class represents a quantity of time
 class Time
        # Internally, the quantity of time is stored in minutes
-       readable writable attr _min: Int
+       readable writable attr _min: Int = 0
 
        # The quantity ot time (in hours)
        meth hour: Int
@@ -39,9 +39,7 @@ class Time
        # The quantity of tyme in human readable form (h:m)
        redef meth to_s: String
        do
-               var s = hour.to_s               # Get the h
-               s.add(':')
-               s.append((_min % 60).to_s)      # Append the m
+               var s = "{hour}:{min%60}"
                return s
        end