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
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22 def first_key_position @first_key_position end |
#key_step ⇒ Object
Returns the value of attribute key_step
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22 def key_step @key_step end |
#readonly? ⇒ Object
Returns the value of attribute readonly?
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22
def readonly?
@readonly?
end
|
#request_policy ⇒ Object
Returns the value of attribute request_policy
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22 def request_policy @request_policy end |
#response_policy ⇒ Object
Returns the value of attribute response_policy
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22 def response_policy @response_policy end |
#subcommands ⇒ Object
Returns the value of attribute subcommands
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22 def subcommands @subcommands end |
#write? ⇒ Object
Returns the value of attribute write?
22 23 24 |
# File 'lib/redis_client/cluster/command.rb', line 22
def write?
@write?
end
|
Instance Method Details
#extract_first_key(command) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/redis_client/cluster/command.rb', line 33 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
43 44 45 |
# File 'lib/redis_client/cluster/command.rb', line 43 def should_send_to_primary? write? end |
#should_send_to_replica? ⇒ Boolean
47 48 49 |
# File 'lib/redis_client/cluster/command.rb', line 47 def should_send_to_replica? readonly? end |