Reputation: 15491
How would one create a named variable, assign seconds to it, and use it for doing calculations?
start_sec = 10.seconds
end_sec = 20.seconds
start_sec + end_sec
does not return correct values
Upvotes: 0
Views: 104
Reputation: 15089
Ugly solution:
start_sec = eval("10.seconds")
end_sec = eval("20.seconds")
start_sec + end_sec
Not sure if you mean this.
Upvotes: 1