Class: CommandPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/helper/system_command.rb

Overview

pipeline for command list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandPipeline

Returns a new instance of CommandPipeline.



30
31
32
# File 'lib/helper/system_command.rb', line 30

def initialize
  @pipeline = []
end

Instance Attribute Details

#pipelineObject (readonly)

Returns the value of attribute pipeline.



28
29
30
# File 'lib/helper/system_command.rb', line 28

def pipeline
  @pipeline
end

Instance Method Details

#add(command) ⇒ Object



34
35
36
# File 'lib/helper/system_command.rb', line 34

def add(command)
  @pipeline << command
end

#runObject



38
39
40
41
42
# File 'lib/helper/system_command.rb', line 38

def run
  @pipeline.each do |command|
    SystemCommand.exec_command(command)
  end
end