Method: Conflow::Redis::Identifier::ClassMethods#key_template

Defined in:
lib/conflow/redis/identifier.rb

#key_templateString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Template for building keys for fields using only the ID.

Examples:

default key

class My::Super::Class < Conflow::Redis::Field
  include Conflow::Redis::Identifier
end

My::Super::Class.key_template #=> "my:super:class:%<id>d"

Returns:

  • (String)

    Template for building redis keys



49
50
51
# File 'lib/conflow/redis/identifier.rb', line 49

def key_template
  @key_template ||= [*name.downcase.split("::"), "%<id>d"].join(":")
end