Module: AppHelper
- Defined in:
- spec/spec_helper.rb
Overview
A module that provides helper methods for application functionality.
The AppHelper module encapsulates various utility methods that support core application operations, including JSON object parsing and chat configuration management.
Instance Method Summary collapse
-
#chat_default_config(argv = []) ⇒ Array<String>
The chat_default_config method constructs a default configuration array for chat sessions.
-
#json_object(json_string) ⇒ JSON::GenericObject
The json_object method parses a JSON string into a structured object.
Instance Method Details
#chat_default_config(argv = []) ⇒ Array<String>
The chat_default_config method constructs a default configuration array for chat sessions.
This method initializes a configuration array with a default config file path and any additional arguments provided.
141 142 143 |
# File 'spec/spec_helper.rb', line 141 def chat_default_config(argv = []) argv + %w[ -f lib/ollama_chat/ollama_chat_config/default_config.yml ] end |
#json_object(json_string) ⇒ JSON::GenericObject
The json_object method parses a JSON string into a structured object.
125 126 127 128 |
# File 'spec/spec_helper.rb', line 125 def json_object(json_string) json_string.full? or return JSON.parse(json_string, object_class: JSON::GenericObject) end |