Sha256: eef83b45e839af1349c595eaf44ae3352557ac54c8a1f57377c1c9b4bb04f8af

Contents?: true

Size: 483 Bytes

Versions: 102

Compression:

Stored size: 483 Bytes

Contents

module Docman
  class CompositeCommand
    def initialize(caller = nil)
      @caller = caller
      @commands = []
    end

    def add_command(cmd)
      @commands << cmd
    end

    def add_commands(cmds, context = nil)
      return if cmds.nil?
      cmds.each do |k, v|
        @commands << Docman::Command.create(k, v, context)
      end
    end

    def perform
      @commands.each { |cmd| cmd.perform }
    end

    def has_commands?
      @commands.any?
    end

  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
docman-0.0.47 lib/docman/commands/composite_command.rb
docman-0.0.46 lib/docman/commands/composite_command.rb
docman-0.0.45 lib/docman/commands/composite_command.rb
docman-0.0.44 lib/docman/commands/composite_command.rb
docman-0.0.43 lib/docman/commands/composite_command.rb
docman-0.0.42 lib/docman/commands/composite_command.rb
docman-0.0.41 lib/docman/commands/composite_command.rb
docman-0.0.40 lib/docman/commands/composite_command.rb
docman-0.0.39 lib/docman/commands/composite_command.rb
docman-0.0.38 lib/docman/commands/composite_command.rb
docman-0.0.37 lib/docman/commands/composite_command.rb
docman-0.0.36 lib/docman/commands/composite_command.rb
docman-0.0.35 lib/docman/commands/composite_command.rb
docman-0.0.34 lib/docman/commands/composite_command.rb
docman-0.0.33 lib/docman/commands/composite_command.rb
docman-0.0.32 lib/docman/commands/composite_command.rb
docman-0.0.31 lib/docman/commands/composite_command.rb
docman-0.0.30 lib/docman/commands/composite_command.rb
docman-0.0.29 lib/docman/commands/composite_command.rb
docman-0.0.28 lib/docman/commands/composite_command.rb