Sha256: 18e603dfb35149fb62a0672c53348b052d8bf675c5620045e6a393dbb3346c17

Contents?: true

Size: 441 Bytes

Versions: 9

Compression:

Stored size: 441 Bytes

Contents

# == Synopsis
# add an elapse_time_s method to Numeric
class Numeric
  my_extension("elapsed_time_s") do
    # return String formated as "HH:MM:SS"
    def elapsed_time_s
      seconds = self
      hours = minutes = 0
      hours = seconds.div 3600
      seconds = seconds - (hours * 3600)
      minutes = seconds.div 60
      seconds = seconds - (minutes * 60)
      sprintf("%2.2d:%2.2d:%2.2d", hours, minutes, seconds)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
royw-dvdprofiler2xbmc-0.0.15 lib/numeric_extensions.rb
royw-dvdprofiler2xbmc-0.0.17 lib/numeric_extensions.rb
royw-dvdprofiler2xbmc-0.0.18 lib/numeric_extensions.rb
royw-dvdprofiler2xbmc-0.0.19 lib/numeric_extensions.rb
royw-dvdprofiler_collection-0.0.2 lib/numeric_extensions.rb
royw-dvdprofiler_collection-0.0.3 lib/numeric_extensions.rb
royw-dvdprofiler_collection-0.1.0 lib/numeric_extensions.rb
royw-dvdprofiler_collection-0.1.1 lib/numeric_extensions.rb
royw-dvdprofiler_collection-0.1.2 lib/numeric_extensions.rb