Method: Cukeregator::Aggregator#duration_string
- Defined in:
- lib/cukeregator/aggregator.rb
#duration_string ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cukeregator/aggregator.rb', line 68 def duration_string hours = (duration / 3600).to_i min_sec = duration % 3600 minutes = (min_sec / 60).to_i seconds = min_sec % 60 s = "" s += "#{hours}h" if hours > 0 s += "#{minutes}m" s += "#{seconds.to_s[0..5]}s" s end |