lib/redis_failover/node.rb in redis_failover-0.9.7.2 vs lib/redis_failover/node.rb in redis_failover-1.0.0
- old
+ new
@@ -20,10 +20,11 @@
#
# @param [Hash] options the options used to create the node
# @option options [String] :host the host of the redis server
# @option options [String] :port the port of the redis server
def initialize(options = {})
- @host = options.fetch(:host) { raise InvalidNodeError, 'missing host'}
+ @host = options[:host]
+ raise InvalidNodeError, 'missing host' if @host.to_s.empty?
@port = Integer(options[:port] || 6379)
@password = options[:password]
end
# @return [Boolean] true if this node is a master, false otherwise