Sha256: 24ae86b82fdac44059a7804402ce76ed161c2423da3b437064ab9994c53e24dd
Contents?: true
Size: 380 Bytes
Versions: 1
Compression:
Stored size: 380 Bytes
Contents
module Gcode # provides methods to make human readable output. module PrettyOutput private def seconds_to_words(seconds) [[60, :seconds], [60, :minutes], [24, :hours], [1000, :days]].map{ |count, name| if seconds > 0 seconds, n = seconds.divmod(count) "#{n.to_i} #{name}" end }.compact.reverse.join(' ') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gcode-0.0.1 | lib/gcode/pretty_output.rb |