Class: Voot::CueTiming
- Inherits:
-
Object
- Object
- Voot::CueTiming
- Defined in:
- lib/voot/cue_timing.rb
Instance Attribute Summary collapse
-
#start_timestamp ⇒ Object
readonly
Returns the value of attribute start_timestamp.
-
#stop_timestamp ⇒ Object
readonly
Returns the value of attribute stop_timestamp.
Instance Method Summary collapse
- #cover?(seconds) ⇒ Boolean
-
#initialize(start_timestamp, stop_timestamp) ⇒ CueTiming
constructor
A new instance of CueTiming.
- #to_webvtt ⇒ Object
Constructor Details
#initialize(start_timestamp, stop_timestamp) ⇒ CueTiming
Returns a new instance of CueTiming.
7 8 9 10 |
# File 'lib/voot/cue_timing.rb', line 7 def initialize(, ) @start_timestamp = @stop_timestamp = end |
Instance Attribute Details
#start_timestamp ⇒ Object (readonly)
Returns the value of attribute start_timestamp.
5 6 7 |
# File 'lib/voot/cue_timing.rb', line 5 def @start_timestamp end |
#stop_timestamp ⇒ Object (readonly)
Returns the value of attribute stop_timestamp.
5 6 7 |
# File 'lib/voot/cue_timing.rb', line 5 def @stop_timestamp end |
Instance Method Details
#cover?(seconds) ⇒ Boolean
16 17 18 |
# File 'lib/voot/cue_timing.rb', line 16 def cover?(seconds) seconds.between?(.seconds_since_origin, .seconds_since_origin) end |
#to_webvtt ⇒ Object
12 13 14 |
# File 'lib/voot/cue_timing.rb', line 12 def to_webvtt .to_webvtt << " --> " << .to_webvtt end |