Module: OllamaChat::UUIDV7

Defined in:
lib/ollama_chat/uuid_v7.rb

Overview

Provides functionality to generate UUID version 7 (time-ordered) identifiers. This module ensures compatibility across different Ruby versions by using native SecureRandom.uuid_v7 when available, and providing a custom implementation for older versions (e.g., Ruby < 3.3).

Class Method Summary collapse

Class Method Details

.generateString

Generates a UUID version 7 identifier according to RFC 9562. This custom implementation is used for Ruby versions where SecureRandom.uuid_v7 is not natively available.

Returns:

  • (String)

    A time-ordered UUID v7 string.



12
13
14
# File 'lib/ollama_chat/uuid_v7.rb', line 12

def self.generate
  SecureRandom.uuid_v7
end