Class: Lutaml::Xsd::TypeSearcher::SearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/xsd/type_searcher.rb

Overview

Search result with relevance score

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(qualified_name:, local_name:, namespace:, category:, schema_file:, documentation:, relevance_score:, match_type:, definition:) ⇒ SearchResult

Returns a new instance of SearchResult.



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/lutaml/xsd/type_searcher.rb', line 14

def initialize(qualified_name:, local_name:, namespace:, category:,
               schema_file:, documentation:, relevance_score:,
               match_type:, definition:)
  @qualified_name = qualified_name
  @local_name = local_name
  @namespace = namespace
  @category = category
  @schema_file = schema_file
  @documentation = documentation
  @relevance_score = relevance_score
  @match_type = match_type
  @definition = definition
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def category
  @category
end

#definitionObject (readonly)

Returns the value of attribute definition.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def definition
  @definition
end

#documentationObject (readonly)

Returns the value of attribute documentation.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def documentation
  @documentation
end

#local_nameObject (readonly)

Returns the value of attribute local_name.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def local_name
  @local_name
end

#match_typeObject (readonly)

Returns the value of attribute match_type.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def match_type
  @match_type
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def namespace
  @namespace
end

#qualified_nameObject (readonly)

Returns the value of attribute qualified_name.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def qualified_name
  @qualified_name
end

#relevance_scoreObject (readonly)

Returns the value of attribute relevance_score.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def relevance_score
  @relevance_score
end

#schema_fileObject (readonly)

Returns the value of attribute schema_file.



10
11
12
# File 'lib/lutaml/xsd/type_searcher.rb', line 10

def schema_file
  @schema_file
end

Instance Method Details

#to_hHash

Convert to hash for JSON/YAML output

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/lutaml/xsd/type_searcher.rb', line 30

def to_h
  {
    qualified_name: qualified_name,
    local_name: local_name,
    namespace: namespace,
    category: category,
    schema_file: schema_file,
    documentation: documentation,
    relevance_score: relevance_score,
    match_type: match_type,
  }
end