Class: RedisClient::Cluster::Command::Spec
- Inherits:
-
Struct
- Object
- Struct
- RedisClient::Cluster::Command::Spec
- Defined in:
- lib/redis_client/cluster/command.rb
Overview
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?.
-
#request_policy ⇒ Object
Returns the value of attribute request_policy.
-
#response_policy ⇒ Object
Returns the value of attribute response_policy.
-
#subcommands ⇒ Object
Returns the value of attribute subcommands.
-
#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
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21 def first_key_position @first_key_position end |
#key_step ⇒ Object
Returns the value of attribute key_step
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21 def key_step @key_step end |
#readonly? ⇒ Object
Returns the value of attribute readonly?
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21
def readonly?
@readonly?
end
|
#request_policy ⇒ Object
Returns the value of attribute request_policy
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21 def request_policy @request_policy end |
#response_policy ⇒ Object
Returns the value of attribute response_policy
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21 def response_policy @response_policy end |
#subcommands ⇒ Object
Returns the value of attribute subcommands
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21 def subcommands @subcommands end |
#write? ⇒ Object
Returns the value of attribute write?
21 22 23 |
# File 'lib/redis_client/cluster/command.rb', line 21
def write?
@write?
end
|
Instance Method Details
#extract_first_key(command) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/redis_client/cluster/command.rb', line 32 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
42 43 44 |
# File 'lib/redis_client/cluster/command.rb', line 42 def should_send_to_primary? write? end |
#should_send_to_replica? ⇒ Boolean
46 47 48 |
# File 'lib/redis_client/cluster/command.rb', line 46 def should_send_to_replica? readonly? end |