The code below is longer than the recommended 80 characters.
I've tried to break it up and concatenate it with + operator and << operator, but it doesn't seem to work. I've tried the .to_s method and moved the colons into their own string but to no avail.
What would be the correct way to split this up onto 2 or 3 lines without getting the no method "+@":String error?
string = "#{sprintf("%02i", hours)}:#{sprintf("%02i", minutes)}:#{sprintf("%02i", seconds)}"
Timeobject instead of yourhour,minute,secondintegers, you could usetime.strftime(%H:%M:%S).