playtime 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Playtime
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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
- hours > 0 ? "#{hours}:#{"%02d" % minutes}:#{"%02d" % seconds}" : "#{"%02d" % minutes}:#{"%02d" % seconds}"
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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: playtime
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brandon Hansen