summaryrefslogtreecommitdiff
path: root/lib/ohai/mixin/seconds_to_human.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/mixin/seconds_to_human.rb')
-rw-r--r--lib/ohai/mixin/seconds_to_human.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ohai/mixin/seconds_to_human.rb b/lib/ohai/mixin/seconds_to_human.rb
index 6d888970..aa7bb1e7 100644
--- a/lib/ohai/mixin/seconds_to_human.rb
+++ b/lib/ohai/mixin/seconds_to_human.rb
@@ -19,6 +19,11 @@
module Ohai
module Mixin
module SecondsToHuman
+ # given the number of seconds return a day/hours/minutes/seconds human form
+ #
+ # @param seconds [Integer]
+ #
+ # @return String
def seconds_to_human(seconds)
days = seconds.to_i / 86400
seconds -= 86400 * days