Class: OllamaChat::Switches::CombinedSwitch
- Inherits:
-
Object
- Object
- OllamaChat::Switches::CombinedSwitch
- Includes:
- CheckSwitch
- Defined in:
- lib/ollama_chat/switches.rb
Overview
Manages a boolean state based on a dynamic proc evaluation.
The CombinedSwitch class is useful for complex conditions that depend on multiple factors or dynamic values, such as combining multiple switch states into a single effective state.
Instance Method Summary collapse
-
#initialize(value:, msg:) ⇒ CombinedSwitch
constructor
Initializes a new CombinedSwitch instance.
-
#value ⇒ Boolean
Returns the result of calling the stored proc.
Methods included from CheckSwitch
Constructor Details
#initialize(value:, msg:) ⇒ CombinedSwitch
Initializes a new CombinedSwitch instance.
163 164 165 166 |
# File 'lib/ollama_chat/switches.rb', line 163 def initialize(value:, msg:) @value = value @msg = msg end |
Instance Method Details
#value ⇒ Boolean
Returns the result of calling the stored proc.
171 172 173 |
# File 'lib/ollama_chat/switches.rb', line 171 def value @value.() end |