Sha256: ff7135b088fb3f402768c161380e292a967db464580d504504531ef19ebedffc
Contents?: true
Size: 753 Bytes
Versions: 19
Compression:
Stored size: 753 Bytes
Contents
module HammerCLI class AbstractConnector def initialize(params={}) end end class Connection def initialize(logger = nil) @logger = logger end def drop(name) connections.delete(name) end def drop_all() connections.keys.each { |c| drop(c) } end def create(name, &create_connector_block) unless connections[name] connector = yield @logger.debug("Registered: #{name}") if @logger connections[name] = connector end connections[name] end def exist?(name) !get(name).nil? end def get(name) connections[name] end private def connections @connections_hash ||= {} @connections_hash end end end
Version data entries
19 entries across 19 versions & 1 rubygems