Class: Jisota::CompositeScript
- Inherits:
-
Object
- Object
- Jisota::CompositeScript
- Defined in:
- lib/jisota/composite_script.rb
Overview
Part of the Script duck type
Contains a list of Scripts and can execute them consectutive. If one script fails, the following will not be executed and the combined result of this script will also be failed (‘false`)
Instance Attribute Summary collapse
-
#scripts ⇒ Object
Returns the value of attribute scripts.
Instance Method Summary collapse
- #execute(ssh_session, logger = nil) ⇒ Object
-
#initialize ⇒ CompositeScript
constructor
A new instance of CompositeScript.
Constructor Details
#initialize ⇒ CompositeScript
Returns a new instance of CompositeScript.
11 12 13 |
# File 'lib/jisota/composite_script.rb', line 11 def initialize @scripts = [] end |
Instance Attribute Details
#scripts ⇒ Object
Returns the value of attribute scripts.
9 10 11 |
# File 'lib/jisota/composite_script.rb', line 9 def scripts @scripts end |
Instance Method Details
#execute(ssh_session, logger = nil) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/jisota/composite_script.rb', line 15 def execute(ssh_session, logger = nil) scripts.each do |inner| result = inner.execute(ssh_session, logger) return false unless result end true end |