Represents a Redis key with utility methods for key manipulation.
Definitionsdef self.[] path
Create a new Key instance.
Signaturepath
String
The key path.
Key
A new Key instance.
def self.[] path
self.new(path)
end
def [] key
Create a child key by appending a subkey.
Signaturekey
String
The subkey to append.
Key
A new Key with the appended subkey.
def [] key
self.class.new("#{@path}:#{key}")
end
def initialize(path)
Initialize a new Key.
Signaturepath
String
The key path.
def initialize(path)
@path = path
end
def size
Get the byte size of the key.
SignatureInteger
The byte size of the key path.
def size
@path.bytesize
end
def to_s
Convert the key to a string.
SignatureString
The key path as a string.
def to_s
@path
end
def to_str
Convert the key to a string (for String compatibility).
SignatureString
The key path as a string.
def to_str
@path
end
def <=> other
Compare this key with another key.
Signatureother
Key
The other key to compare with.
Integer
-1, 0, or 1 for comparison result.
def <=> other
@path <=> other.to_str
end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4