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.27 lib/docman/commands/composite_command.rb
docman-0.0.26 lib/docman/commands/composite_command.rb
docman-0.0.25 lib/docman/commands/composite_command.rb
docman-0.0.24 lib/docman/commands/composite_command.rb
docman-0.0.23 lib/docman/commands/composite_command.rb
docman-0.0.22 lib/docman/commands/composite_command.rb
docman-0.0.21 lib/docman/commands/composite_command.rb
docman-0.0.20 lib/docman/commands/composite_command.rb
docman-0.0.19 lib/docman/commands/composite_command.rb
docman-0.0.18 lib/docman/commands/composite_command.rb
docman-0.0.17 lib/docman/commands/composite_command.rb
docman-0.0.16 lib/docman/commands/composite_command.rb
docman-0.0.15 lib/docman/commands/composite_command.rb
docman-0.0.14 lib/docman/commands/composite_command.rb
docman-0.0.13 lib/docman/commands/composite_command.rb
docman-0.0.12 lib/docman/commands/composite_command.rb
docman-0.0.11 lib/docman/commands/composite_command.rb
docman-0.0.10 lib/docman/commands/composite_command.rb
docman-0.0.9 lib/docman/commands/composite_command.rb
docman-0.0.8 lib/docman/commands/composite_command.rb