Sha256: d9faf026714223868ac17cba5f1382be81168892ae24a544de4774493139406b

Contents?: true

Size: 374 Bytes

Versions: 3

Compression:

Stored size: 374 Bytes

Contents

module PipeRpc
  class Hub::Servers
    def initialize
      @servers = Hash.new{ |hash, key| raise NoServerError.new("no server #{key}") }
    end

    def add(servers)
      servers.each{ |name, server| @servers[name.to_sym] = server }
    end

    def [](name)
      @servers[name.to_sym]
    end

    def remove(name)
      @servers.delete(name.to_sym)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pipe_rpc-1.1.1 lib/pipe_rpc/hub_servers.rb
pipe_rpc-1.1.0 lib/pipe_rpc/hub_servers.rb
pipe_rpc-1.0.0 lib/pipe_rpc/hub_servers.rb