Class: RedisClient::Cluster::Command::Spec
- Inherits:
-
Struct
- Object
- Struct
- RedisClient::Cluster::Command::Spec
- Defined in:
- lib/redis_client/cluster/command.rb
Instance Attribute Summary collapse
-
#first_key_position ⇒ Object
Returns the value of attribute first_key_position.
-
#key_step ⇒ Object
Returns the value of attribute key_step.
-
#readonly? ⇒ Object
Returns the value of attribute readonly?.
-
#write? ⇒ Object
Returns the value of attribute write?.
Instance Method Summary collapse
- #extract_first_key(command) ⇒ Object
- #should_send_to_primary? ⇒ Boolean
- #should_send_to_replica? ⇒ Boolean
Instance Attribute Details
#first_key_position ⇒ Object
Returns the value of attribute first_key_position
15 16 17 |
# File 'lib/redis_client/cluster/command.rb', line 15 def first_key_position @first_key_position end |
#key_step ⇒ Object
Returns the value of attribute key_step
15 16 17 |
# File 'lib/redis_client/cluster/command.rb', line 15 def key_step @key_step end |
#readonly? ⇒ Object
Returns the value of attribute readonly?
15 16 17 |
# File 'lib/redis_client/cluster/command.rb', line 15
def readonly?
@readonly?
end
|
#write? ⇒ Object
Returns the value of attribute write?
15 16 17 |
# File 'lib/redis_client/cluster/command.rb', line 15
def write?
@write?
end
|
Instance Method Details
#extract_first_key(command) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/redis_client/cluster/command.rb', line 23 def extract_first_key(command) i = first_key_position.to_i return command[i] if i > 0 i = determine_first_key_position(command) return ::RedisClient::Cluster::Command::EMPTY_STRING if i == 0 command[i] end |
#should_send_to_primary? ⇒ Boolean
33 34 35 |
# File 'lib/redis_client/cluster/command.rb', line 33 def should_send_to_primary? write? end |
#should_send_to_replica? ⇒ Boolean
37 38 39 |
# File 'lib/redis_client/cluster/command.rb', line 37 def should_send_to_replica? readonly? end |