Class: Voot::CueTiming

Inherits:
Object
  • Object
show all
Defined in:
lib/voot/cue_timing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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)
  @start_timestamp = start_timestamp
  @stop_timestamp = stop_timestamp
end

Instance Attribute Details

#start_timestampObject (readonly)

Returns the value of attribute start_timestamp.



5
6
7
# File 'lib/voot/cue_timing.rb', line 5

def start_timestamp
  @start_timestamp
end

#stop_timestampObject (readonly)

Returns the value of attribute stop_timestamp.



5
6
7
# File 'lib/voot/cue_timing.rb', line 5

def stop_timestamp
  @stop_timestamp
end

Instance Method Details

#cover?(seconds) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/voot/cue_timing.rb', line 16

def cover?(seconds)
  seconds.between?(start_timestamp.seconds_since_origin, stop_timestamp.seconds_since_origin)
end

#to_webvttObject



12
13
14
# File 'lib/voot/cue_timing.rb', line 12

def to_webvtt
  start_timestamp.to_webvtt << " --> " << stop_timestamp.to_webvtt
end