Class: OllamaChat::Utils::TagResolver::TagResult
- Inherits:
-
Struct
- Object
- Struct
- OllamaChat::Utils::TagResolver::TagResult
- Defined in:
- lib/ollama_chat/utils/tag_resolver.rb
Overview
A lightweight struct representing a single tag entry. It extends the base Struct with convenience methods for generating human‑readable messages and JSON representations.
Instance Method Summary collapse
-
#as_json(*a) ⇒ Hash
Convert to a hash suitable for JSON serialization.
-
#kind_type ⇒ String
Resolve the full, human‑readable type for the
kindfield using kind_of. -
#message ⇒ String
Human readable description of this tag result.
-
#to_json(*a) ⇒ String
JSON representation of this tag result.
Instance Method Details
#as_json(*a) ⇒ Hash
Convert to a hash suitable for JSON serialization. The rest field is omitted because it contains raw ctags data that isn’t useful outside the library.
55 56 57 58 59 |
# File 'lib/ollama_chat/utils/tag_resolver.rb', line 55 def as_json(*a) hash = super hash.delete('rest') hash | { 'message' => , 'kind_type' => kind_type } end |
#kind_type ⇒ String
Resolve the full, human‑readable type for the kind field using OllamaChat::Utils::TagResolver.kind_of.
47 48 49 |
# File 'lib/ollama_chat/utils/tag_resolver.rb', line 47 def kind_type OllamaChat::Utils::TagResolver.kind_of(kind) end |
#message ⇒ String
Returns Human readable description of this tag result.
40 41 42 |
# File 'lib/ollama_chat/utils/tag_resolver.rb', line 40 def "#{symbol} of kind #{kind} (#{kind_type}) at #{filename}:#{linenumber}" end |
#to_json(*a) ⇒ String
JSON representation of this tag result. Delegates to as_json.
63 64 65 |
# File 'lib/ollama_chat/utils/tag_resolver.rb', line 63 def to_json(*a) as_json.to_json(*a) end |