nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: update sav/test_new_native_alt1.res because line change in array
[nit.git]
/
tests
/
example_time.nit
diff --git
a/tests/example_time.nit
b/tests/example_time.nit
index
ae694d6
..
b7af43e
100644
(file)
--- a/
tests/example_time.nit
+++ b/
tests/example_time.nit
@@
-20,28
+20,26
@@
# The Time class represents a quantity of time
class Time
# Internally, the quantity of time is stored in minutes
# The Time class represents a quantity of time
class Time
# Internally, the quantity of time is stored in minutes
- readable writable attr _min: Int = 0
+ var min: Int = 0
# The quantity ot time (in hours)
# The quantity ot time (in hours)
- meth hour: Int
+ fun hour: Int
do
# Need to transform minutes in hours
do
# Need to transform minutes in hours
- return _min / 60
+ return min / 60
end
# Set the quantity of time (in hour)
end
# Set the quantity of time (in hour)
- meth hour=(i: Int)
+ fun hour=(i: Int)
do
# Need to transform hours in minutes
do
# Need to transform hours in minutes
- _min = i * 60
+ min = i * 60
end
# The quantity of tyme in human readable form (h:m)
end
# The quantity of tyme in human readable form (h:m)
- redef meth to_s: String
+ redef fun to_s: String
do
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
return s
end