Class: DuoSplitter::Services::Support::SplitTracks
- Inherits:
-
Object
- Object
- DuoSplitter::Services::Support::SplitTracks
- Defined in:
- lib/duo_splitter/services/support/split_tracks.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
-
#initialize(context:) ⇒ SplitTracks
constructor
A new instance of SplitTracks.
- #run ⇒ Object
Constructor Details
#initialize(context:) ⇒ SplitTracks
Returns a new instance of SplitTracks.
9 10 11 12 13 14 15 |
# File 'lib/duo_splitter/services/support/split_tracks.rb', line 9 def initialize(context:) @context = context raise Error, "temp_dir isn't set" unless @context.temp_dir @commands = build_commands end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
7 8 9 |
# File 'lib/duo_splitter/services/support/split_tracks.rb', line 7 def commands @commands end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 |
# File 'lib/duo_splitter/services/support/split_tracks.rb', line 17 def run return if @commands.empty? BatchProcessor.new(message: 'splitting...', show_progress: @context.show_progress).run(@commands) end |