Class: Sox::CommandBuilder
- Inherits:
-
Object
- Object
- Sox::CommandBuilder
- Defined in:
- lib/sox/command_builder.rb
Overview
Builds the sox
shell command from input files, an output file, options and effects.
Instance Attribute Summary collapse
-
#effects ⇒ Object
Returns the value of attribute effects.
-
#input_files ⇒ Object
Returns the value of attribute input_files.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output_file ⇒ Object
Returns the value of attribute output_file.
Instance Method Summary collapse
-
#build ⇒ String
Build shell command with all arguments and options.
-
#initialize(input_files, output_file, options = {}, effects = {}) ⇒ CommandBuilder
constructor
A new instance of CommandBuilder.
Constructor Details
#initialize(input_files, output_file, options = {}, effects = {}) ⇒ CommandBuilder
18 19 20 21 22 23 |
# File 'lib/sox/command_builder.rb', line 18 def initialize(input_files, output_file, = {}, effects = {}) @input_files = input_files @output_file = output_file = @effects = effects end |
Instance Attribute Details
#effects ⇒ Object
Returns the value of attribute effects.
12 13 14 |
# File 'lib/sox/command_builder.rb', line 12 def effects @effects end |
#input_files ⇒ Object
Returns the value of attribute input_files.
12 13 14 |
# File 'lib/sox/command_builder.rb', line 12 def input_files @input_files end |
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/sox/command_builder.rb', line 12 def end |
#output_file ⇒ Object
Returns the value of attribute output_file.
12 13 14 |
# File 'lib/sox/command_builder.rb', line 12 def output_file @output_file end |
Instance Method Details
#build ⇒ String
Build shell command with all arguments and options.
28 29 30 31 32 33 34 35 |
# File 'lib/sox/command_builder.rb', line 28 def build [ Sox::SOX_COMMAND, (), build_input_files, build_file(@output_file), build_effects ].flatten.join(' ') end |