Class: Infobar::Duration
Instance Method Summary collapse
-
#initialize(value, format: nil) ⇒ Duration
constructor
A new instance of Duration.
- #to_s ⇒ Object
Constructor Details
#initialize(value, format: nil) ⇒ Duration
Returns a new instance of Duration.
2 3 4 5 6 7 8 9 10 |
# File 'lib/infobar/duration.rb', line 2 def initialize(value, format: nil) duration = Tins::Duration.new(value) @string = if format duration.format(format) else duration end.to_s end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/infobar/duration.rb', line 12 def to_s @string end |