Class: OllamaChat::Switches::CombinedSwitch

Inherits:
Object
  • Object
show all
Includes:
CheckSwitch
Defined in:
lib/ollama_chat/switches.rb

Instance Method Summary collapse

Methods included from CheckSwitch

#off?, #show

Constructor Details

#initialize(value:, msg:) ⇒ CombinedSwitch

The initialize method sets up the switch with a value and message.

Parameters:

  • value (Object)

    the value to be stored

  • msg (Hash)

    the message hash containing true and false keys



72
73
74
75
# File 'lib/ollama_chat/switches.rb', line 72

def initialize(value:, msg:)
  @value = value
  @msg   = msg
end

Instance Method Details

#valueObject

The value method returns the result of calling the stored proc with no arguments.



79
80
81
# File 'lib/ollama_chat/switches.rb', line 79

def value
  @value.()
end