Class: RedisClient::Cluster::NormalizedCmdName

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/redis_client/cluster/normalized_cmd_name.rb

Instance Method Summary collapse

Constructor Details

#initializeNormalizedCmdName

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

#clearObject



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