Sha256: 3d4eb4964c3b66dc54ca11617b8f2ac6c1273ae22b20bf56d777863f43d4d3c8

Contents?: true

Size: 571 Bytes

Versions: 7

Compression:

Stored size: 571 Bytes

Contents

require 'rhcp/rhcp_exception'
require 'rhcp/broker'

module RHCP

  class DispatchingBroker < RHCP::Broker
    def initialize
      @known_commands = Hash.new()
    end
    
    # returns a list of all known commands
    def get_command_list()
      @known_commands
    end  

    def add_broker(new_broker)
      new_broker.get_command_list.each do |name, command|
        raise RHCP::RhcpException.new("duplicate command: '#{name}' has already been defined.") if @known_commands.has_key?(name)
        @known_commands[name] = command
      end
    end
    
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rhcp-0.1.4 lib/rhcp/dispatching_broker.rb
rhcp-0.1.7 lib/rhcp/dispatching_broker.rb
rhcp-0.1.9 lib/rhcp/dispatching_broker.rb
rhcp-0.1.2 lib/rhcp/dispatching_broker.rb
rhcp-0.1.5 lib/rhcp/dispatching_broker.rb
rhcp-0.1.6 lib/rhcp/dispatching_broker.rb
rhcp-0.1.8 lib/rhcp/dispatching_broker.rb