Class: RedisClient::Cluster::NormalizedCmdName
- Inherits:
-
Object
- Object
- RedisClient::Cluster::NormalizedCmdName
- Includes:
- Singleton
- Defined in:
- lib/redis_client/cluster/normalized_cmd_name.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #get_by_command(command) ⇒ Object
- #get_by_name(name) ⇒ Object
- #get_by_subcommand(command) ⇒ Object
-
#initialize ⇒ NormalizedCmdName
constructor
A new instance of NormalizedCmdName.
Constructor Details
#initialize ⇒ NormalizedCmdName
Returns a new instance of NormalizedCmdName.
14 15 16 17 |
# File 'lib/redis_client/cluster/normalized_cmd_name.rb', line 14 def initialize @cache = {} @mutex = Mutex.new end |
Instance Method Details
#clear ⇒ Object
31 32 33 34 |
# File 'lib/redis_client/cluster/normalized_cmd_name.rb', line 31 def clear @mutex.synchronize { @cache.clear } true end |
#get_by_command(command) ⇒ Object
19 20 21 |
# File 'lib/redis_client/cluster/normalized_cmd_name.rb', line 19 def get_by_command(command) get(command, index: 0) end |
#get_by_name(name) ⇒ Object
27 28 29 |
# File 'lib/redis_client/cluster/normalized_cmd_name.rb', line 27 def get_by_name(name) get(name, index: 0) end |
#get_by_subcommand(command) ⇒ Object
23 24 25 |
# File 'lib/redis_client/cluster/normalized_cmd_name.rb', line 23 def get_by_subcommand(command) get(command, index: 1) end |