Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (20 sloc) 397 Bytes
require 'command'
class CompositeCommand < Command
def initialize
@commands = []
end
def add_command(command)
@commands << command
end
def execute
@commands.each{|cmd| cmd.execute }
end
def unexecute
@commands.reverse.each{ |cmd| cmd.unexecute }
end
def description
description = ''
@commands.each{ |cmd| description += cmd.description + "\n" }
description
end
end