module Redis::Cluster::NodeKey

Node key's format is `<ip>:<port>`. It is different from node id. Node id is internal identifying code in Redis Cluster.

Constants

DELIMITER

Public Instance Methods

build_from_host_port(host, port) click to toggle source
# File lib/redis/cluster/node_key.rb, line 26
def build_from_host_port(host, port)
  "#{host}#{DELIMITER}#{port}"
end
build_from_uri(uri) click to toggle source
# File lib/redis/cluster/node_key.rb, line 22
def build_from_uri(uri)
  "#{uri.host}#{DELIMITER}#{uri.port}"
end
optionize(node_key) click to toggle source
# File lib/redis/cluster/node_key.rb, line 13
def optionize(node_key)
  host, port = split(node_key)
  { host: host, port: port }
end
split(node_key) click to toggle source
# File lib/redis/cluster/node_key.rb, line 18
def split(node_key)
  node_key.split(DELIMITER)
end