Class: CommandPipeline
- Inherits:
-
Object
- Object
- CommandPipeline
- Defined in:
- lib/helper/system_command.rb
Overview
pipeline for command list
Instance Attribute Summary collapse
-
#pipeline ⇒ Object
readonly
Returns the value of attribute pipeline.
Instance Method Summary collapse
- #add(command) ⇒ Object
-
#initialize ⇒ CommandPipeline
constructor
A new instance of CommandPipeline.
- #run ⇒ Object
Constructor Details
#initialize ⇒ CommandPipeline
Returns a new instance of CommandPipeline.
30 31 32 |
# File 'lib/helper/system_command.rb', line 30 def initialize @pipeline = [] end |
Instance Attribute Details
#pipeline ⇒ Object (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 |
#run ⇒ Object
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 |