Module: Legion::LLM::Deprecation

Extended by:
Legion::Logging::Helper
Defined in:
lib/legion/llm/deprecation.rb

Class Method Summary collapse

Class Method Details

.reset!Object



28
29
30
# File 'lib/legion/llm/deprecation.rb', line 28

def reset!
  @mutex.synchronize { @warned.clear }
end

.warn_once(method_name, replacement:) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/legion/llm/deprecation.rb', line 14

def warn_once(method_name, replacement:)
  return if warned?(method_name)

  @mutex.synchronize { @warned[method_name] = true }
  log.warn(
    "[llm][deprecation] #{method_name} is deprecated and will be removed in the next release. " \
    "Use #{replacement} instead. All callers must migrate before deletion."
  )
end

.warned?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/legion/llm/deprecation.rb', line 24

def warned?(method_name)
  @mutex.synchronize { @warned[method_name] == true }
end