class StatelyDB::KeyPath

def self.to_key_id(value)

Returns:
  • (String) -

Parameters:
  • value (String, StatelyDB::UUID, #to_s) -- The value to convert to a key id.
def self.to_key_id(value)
  if value.is_a?(StatelyDB::UUID)
    value.to_base64
  elsif value.is_a?(String) && value.encoding == Encoding::BINARY
    [value].pack("m0").tr("=", "").tr("+/", "-_")
  else
    # Any other value is just converted to a string
    value.to_s.gsub("/", "%/")
  end
end