Class: ParameterSubstitution::Formatters::DurationAsTime
- Inherits:
-
Base
- Object
- Base
- ParameterSubstitution::Formatters::DurationAsTime
show all
- Defined in:
- lib/parameter_substitution/formatters/duration_as_time.rb
Class Method Summary
collapse
Methods inherited from Base
encoding, has_parameters?, key, parse_duration
Class Method Details
.description ⇒ Object
4
5
6
|
# File 'lib/parameter_substitution/formatters/duration_as_time.rb', line 4
def self.description
"Converts a duration in seconds into hh:mm:ss"
end
|
8
9
10
|
# File 'lib/parameter_substitution/formatters/duration_as_time.rb', line 8
def self.format(duration)
Time.at(parse_duration(duration)).utc.strftime("%H:%M:%S")
end
|