class Jisota::CompositeScript

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`)

Attributes

scripts[RW]

Public Class Methods

new() click to toggle source
# File lib/jisota/composite_script.rb, line 11
def initialize
  @scripts = []
end

Public Instance Methods

execute(context) click to toggle source
# File lib/jisota/composite_script.rb, line 15
def execute(context)
  scripts.each do |inner|
    result = inner.execute(context)
    return false unless result
  end
  true
end