Class: Appydave::Tools::SubtitleMaster::Clean

Inherits:
Object
  • Object
show all
Defined in:
lib/appydave/tools/subtitle_master/clean.rb

Overview

Clean and normalize subtitles

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Clean

Returns a new instance of Clean.



8
9
10
# File 'lib/appydave/tools/subtitle_master/clean.rb', line 8

def initialize(file_path)
  @file_path = file_path
end

Instance Method Details

#cleanObject



12
13
14
15
16
# File 'lib/appydave/tools/subtitle_master/clean.rb', line 12

def clean
  content = File.read(@file_path, encoding: 'UTF-8')
  content = remove_underscores(content)
  normalize_lines(content)
end