Class: OllamaChat::Switches::CombinedSwitch
- Inherits:
-
Object
- Object
- OllamaChat::Switches::CombinedSwitch
- Includes:
- CheckSwitch
- Defined in:
- lib/ollama_chat/switches.rb
Overview
A switch class that manages a boolean state based on a proc value.
The CombinedSwitch class provides a way to manage a boolean configuration option where the state is determined by evaluating a stored proc. This 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
The initialize method sets up the switch with a value and message.
-
#value ⇒ Object
The value method returns the result of calling the stored proc with no arguments.
Methods included from CheckSwitch
Constructor Details
#initialize(value:, msg:) ⇒ CombinedSwitch
The initialize method sets up the switch with a value and message.
121 122 123 124 |
# File 'lib/ollama_chat/switches.rb', line 121 def initialize(value:, msg:) @value = value @msg = msg end |
Instance Method Details
#value ⇒ Object
The value method returns the result of calling the stored proc with no arguments.
128 129 130 |
# File 'lib/ollama_chat/switches.rb', line 128 def value @value.() end |