Module: OllamaAgent::TimeoutParam
- Defined in:
- lib/ollama_agent/timeout_param.rb
Overview
Parses positive integer seconds for HTTP timeouts (OLLAMA_AGENT_TIMEOUT, CLI –timeout).
Class Method Summary collapse
Class Method Details
.parse_positive(raw) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ollama_agent/timeout_param.rb', line 8 def parse_positive(raw) return nil if raw.nil? return nil if raw.is_a?(String) && raw.strip.empty? t = Integer(raw) return nil unless t.positive? t rescue ArgumentError, TypeError nil end |