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.
132 133 134 |
# File 'spec/spec_helper.rb', line 132 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.
116 117 118 119 |
# File 'spec/spec_helper.rb', line 116 def json_object(json_string) json_string.full? or return JSON.parse(json_string, object_class: JSON::GenericObject) end |