playtime 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/playtime/version.rb +1 -1
- data/lib/playtime.rb +8 -2
- metadata +1 -1
data/lib/playtime/version.rb
CHANGED
data/lib/playtime.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Integer
|
2
2
|
|
3
3
|
def to_playtime
|
4
|
-
Playtime.new(self)
|
4
|
+
Playtime.new(self) unless nil?
|
5
5
|
end
|
6
6
|
|
7
7
|
end
|
@@ -14,7 +14,13 @@ class Playtime
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_s
|
17
|
-
|
17
|
+
return if @time.nil?
|
18
|
+
|
19
|
+
if hours > 0
|
20
|
+
"#{hours}:#{"%02d" % minutes}:#{"%02d" % seconds}"
|
21
|
+
else
|
22
|
+
"#{"%02d" % minutes}:#{"%02d" % seconds}"
|
23
|
+
end
|
18
24
|
end
|
19
25
|
|
20
26
|
def seconds
|