Class: RedisClient::Cluster::Node::Info
- Inherits:
-
Struct
- Object
- Struct
- RedisClient::Cluster::Node::Info
- Defined in:
- lib/redis_client/cluster/node.rb
Instance Attribute Summary collapse
-
#config_epoch ⇒ Object
Returns the value of attribute config_epoch.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link_state ⇒ Object
Returns the value of attribute link_state.
-
#node_key ⇒ Object
Returns the value of attribute node_key.
-
#ping_sent ⇒ Object
Returns the value of attribute ping_sent.
-
#pong_recv ⇒ Object
Returns the value of attribute pong_recv.
-
#primary_id ⇒ Object
Returns the value of attribute primary_id.
-
#role ⇒ Object
Returns the value of attribute role.
-
#slots ⇒ Object
Returns the value of attribute slots.
Instance Method Summary collapse
Instance Attribute Details
#config_epoch ⇒ Object
Returns the value of attribute config_epoch
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def config_epoch @config_epoch end |
#id ⇒ Object
Returns the value of attribute id
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def id @id end |
#link_state ⇒ Object
Returns the value of attribute link_state
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def link_state @link_state end |
#node_key ⇒ Object
Returns the value of attribute node_key
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def node_key @node_key end |
#ping_sent ⇒ Object
Returns the value of attribute ping_sent
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def ping_sent @ping_sent end |
#pong_recv ⇒ Object
Returns the value of attribute pong_recv
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def pong_recv @pong_recv end |
#primary_id ⇒ Object
Returns the value of attribute primary_id
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def primary_id @primary_id end |
#role ⇒ Object
Returns the value of attribute role
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def role @role end |
#slots ⇒ Object
Returns the value of attribute slots
34 35 36 |
# File 'lib/redis_client/cluster/node.rb', line 34 def slots @slots end |
Instance Method Details
#primary? ⇒ Boolean
40 41 42 |
# File 'lib/redis_client/cluster/node.rb', line 40 def primary? role == 'master' end |
#replica? ⇒ Boolean
44 45 46 |
# File 'lib/redis_client/cluster/node.rb', line 44 def replica? role == 'slave' end |
#serialize(str) ⇒ Object
48 49 50 |
# File 'lib/redis_client/cluster/node.rb', line 48 def serialize(str) str << id << node_key << role << primary_id << config_epoch end |