Class: SRTParser
- Inherits:
-
Object
- Object
- SRTParser
- Defined in:
- lib/rsrt/srt_parser.rb
Instance Attribute Summary collapse
-
#subtitles ⇒ Object
readonly
Returns the value of attribute subtitles.
Instance Method Summary collapse
-
#initialize(srt_file_path) ⇒ SRTParser
constructor
A new instance of SRTParser.
Constructor Details
#initialize(srt_file_path) ⇒ SRTParser
Returns a new instance of SRTParser.
7 8 9 10 11 12 13 14 |
# File 'lib/rsrt/srt_parser.rb', line 7 def initialize(srt_file_path) @srt_file_path = srt_file_path @regex_subtitle_id = Regexp.new('^\d+$') @regex_time_range = Regexp.new('^\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}$') @regex_text = Regexp.new('^.+$') @subtitles = Array.new parse end |
Instance Attribute Details
#subtitles ⇒ Object (readonly)
Returns the value of attribute subtitles.
5 6 7 |
# File 'lib/rsrt/srt_parser.rb', line 5 def subtitles @subtitles end |