Class: Chaussettes::Tool

Inherits:
Object
  • Object
show all
Defined in:
lib/chaussettes/tool.rb

Overview

a generic wrapper for sox audio toolchain

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Tool

Returns a new instance of Tool.



7
8
9
10
# File 'lib/chaussettes/tool.rb', line 7

def initialize(command)
  @command = command
  @arguments = []
end

Instance Method Details

#<<(arg) ⇒ Object



12
13
14
15
# File 'lib/chaussettes/tool.rb', line 12

def <<(arg)
  @arguments << arg
  self
end

#concat(args) ⇒ Object



17
18
19
20
# File 'lib/chaussettes/tool.rb', line 17

def concat(args)
  @arguments.concat(args)
  self
end

#to_sObject



22
23
24
# File 'lib/chaussettes/tool.rb', line 22

def to_s
  Shellwords.join([ @command, *@arguments ])
end