Class: Enparallel::Command
- Inherits:
-
Object
- Object
- Enparallel::Command
- Defined in:
- lib/enparallel/command.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, args) ⇒ Command
constructor
A new instance of Command.
- #interpolate_safe(replacement) ⇒ Object
- #interpolate_unsafe(replacement) ⇒ Object
Constructor Details
#initialize(name, args) ⇒ Command
Returns a new instance of Command.
3 4 5 6 |
# File 'lib/enparallel/command.rb', line 3 def initialize(name, args) @name = name @args = args end |
Class Method Details
.from_a(a) ⇒ Object
8 9 10 11 |
# File 'lib/enparallel/command.rb', line 8 def self.from_a(a) name, *args = a Command.new(name, args) end |
Instance Method Details
#interpolate_safe(replacement) ⇒ Object
13 14 15 |
# File 'lib/enparallel/command.rb', line 13 def interpolate_safe(replacement) [@name, *replace(replacement)].shelljoin end |
#interpolate_unsafe(replacement) ⇒ Object
17 18 19 |
# File 'lib/enparallel/command.rb', line 17 def interpolate_unsafe(replacement) [@name, *replace(replacement)].join(' ') end |