Class: CleoQualityReview::LlmProviders::Stub::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/cleo_quality_review/llm_providers/stub.rb

Overview

Configuration for the stub LLM provider.

Constant Summary collapse

DEFAULT_RESPONSE =
"This is a stub review response for testing."

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env: ENV) ⇒ Config

Returns a new instance of Config.

Parameters:

  • env (Hash{String => String}) (defaults to: ENV) —

    environment variables (unused, for interface compatibility)



38
39
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 38

def initialize(env: ENV)
end

Class Method Details

.reset! ⇒ void

This method returns an undefined value.

Reset to default response.



31
32
33
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 31

def reset!
  @response = nil
end

.response ⇒ String, Proc

Returns the configured response.

Returns:

  • (String, Proc) —

    the configured response



24
25
26
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 24

def response
  @response || DEFAULT_RESPONSE
end

.response=(response) ⇒ void

This method returns an undefined value.

Configure the response for all stub clients.

Parameters:

  • response (String, Proc) —

    fixed response or callable



18
19
20
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 18

def response=(response)
  @response = response
end

Instance Method Details

#configured? ⇒ Boolean

Returns always true for stub.

Returns:

  • (Boolean) —

    always true for stub



49
50
51
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 49

def configured?
  true
end

#response ⇒ String

Returns the configured response.

Returns:

  • (String) —

    the configured response



43
44
45
# File 'lib/cleo_quality_review/llm_providers/stub.rb', line 43

def response
  self.class.response
end