Class: Lutaml::UmlRepository::SearchResult
- Inherits:
-
Model::Serializable
- Object
- Model::Serializable
- Lutaml::UmlRepository::SearchResult
- Defined in:
- lib/lutaml/uml_repository/search_result.rb
Overview
Immutable value object representing a search result.
Wraps a UML element (Class, Attribute, Association, etc.) with metadata about how it matched the search query.
Uses lutaml-model for automatic JSON/YAML serialization.
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
The UML element that matched (not serialized - internal use only).
Instance Method Summary collapse
-
#initialize(element_type:, qualified_name:, package_path:, match_field:, element: nil, match_context: nil) ⇒ SearchResult
constructor
Override initialize to accept element parameter.
Constructor Details
#initialize(element_type:, qualified_name:, package_path:, match_field:, element: nil, match_context: nil) ⇒ SearchResult
Override initialize to accept element parameter
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/lutaml/uml_repository/search_result.rb', line 50 def initialize( # rubocop:disable Metrics/ParameterLists element_type:, qualified_name:, package_path:, match_field:, element: nil, match_context: nil ) # Store element before calling super (not for serialization) @element = element # Initialize lutaml-model with serializable attributes only super( element_type: element_type.to_s, qualified_name: qualified_name, package_path: package_path, match_field: match_field.to_s, match_context: match_context || {} ) freeze end |
Instance Attribute Details
#element ⇒ Object (readonly)
The UML element that matched (not serialized - internal use only)
40 41 42 |
# File 'lib/lutaml/uml_repository/search_result.rb', line 40 def element @element end |