Class: Tucue::Marker::Mark
- Inherits:
-
Struct
- Object
- Struct
- Tucue::Marker::Mark
- Defined in:
- lib/tucue/marker.rb
Overview
A single mark: time is the playback position in seconds and label is an optional user-supplied note.
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#timestamp ⇒ Object
Format the time as HH:MM:SS.
- #to_h ⇒ Object
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label
11 12 13 |
# File 'lib/tucue/marker.rb', line 11 def label @label end |
#time ⇒ Object
Returns the value of attribute time
11 12 13 |
# File 'lib/tucue/marker.rb', line 11 def time @time end |
Instance Method Details
#timestamp ⇒ Object
Format the time as HH:MM:SS.
13 14 15 16 |
# File 'lib/tucue/marker.rb', line 13 def total = time.to_i format("%02d:%02d:%02d", total / 3600, (total % 3600) / 60, total % 60) end |
#to_h ⇒ Object
18 19 20 |
# File 'lib/tucue/marker.rb', line 18 def to_h {timestamp: , seconds: time.to_f.round(3), label: label} end |