Does Ruby have a class that represents some period of time?
IE, 1 hour, 2 minutes, 3 seconds.
I realize there is the time class, but the constructor takes a year, month, and day. None of those are relevant to the abstraction that I’m trying to create.
Note: Working with Sinatra.
You might wish to look into the
ActiveSupport::CoreExtensions::Numeric::Timemodule of Ruby on Rails. It allows you to do neat things likeIt greatly utilizes the Rails class ActiveSupport::Duration.