Class: Appydave::Tools::SubtitleMaster::Join::SRTParser::Subtitle

Inherits:
Object
  • Object
show all
Defined in:
lib/appydave/tools/subtitle_manager/join.rb

Overview

Represents a single subtitle entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, start_time:, end_time:, text:) ⇒ Subtitle

Returns a new instance of Subtitle.



61
62
63
64
65
66
# File 'lib/appydave/tools/subtitle_manager/join.rb', line 61

def initialize(index:, start_time:, end_time:, text:)
  @index = index
  @start_time = parse_timestamp(start_time)
  @end_time = parse_timestamp(end_time)
  @text = text.strip
end

Instance Attribute Details

#end_timeObject (readonly)

Returns the value of attribute end_time.



59
60
61
# File 'lib/appydave/tools/subtitle_manager/join.rb', line 59

def end_time
  @end_time
end

#indexObject (readonly)

Returns the value of attribute index.



59
60
61
# File 'lib/appydave/tools/subtitle_manager/join.rb', line 59

def index
  @index
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



59
60
61
# File 'lib/appydave/tools/subtitle_manager/join.rb', line 59

def start_time
  @start_time
end

#textObject (readonly)

Returns the value of attribute text.



59
60
61
# File 'lib/appydave/tools/subtitle_manager/join.rb', line 59

def text
  @text
end