Class: Lutaml::Xsd::BatchQueryResult

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

Overview

Value object for batch query result Encapsulates individual query result with metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query:, resolved:, result:) ⇒ BatchQueryResult

Returns a new instance of BatchQueryResult.



50
51
52
53
54
# File 'lib/lutaml/xsd/batch_type_query.rb', line 50

def initialize(query:, resolved:, result:)
  @query = query
  @resolved = resolved
  @result = result
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



48
49
50
# File 'lib/lutaml/xsd/batch_type_query.rb', line 48

def query
  @query
end

#resolvedObject (readonly)

Returns the value of attribute resolved.



48
49
50
# File 'lib/lutaml/xsd/batch_type_query.rb', line 48

def resolved
  @resolved
end

#resultObject (readonly)

Returns the value of attribute result.



48
49
50
# File 'lib/lutaml/xsd/batch_type_query.rb', line 48

def result
  @result
end

Instance Method Details

#to_hHash

Convert to hash representation

Returns:

  • (Hash)

    Hash representation of the result



58
59
60
61
62
63
64
65
66
# File 'lib/lutaml/xsd/batch_type_query.rb', line 58

def to_h
  {
    query: query,
    resolved: resolved,
    qualified_name: result.qname,
    namespace: result.namespace,
    type_class: resolved ? result.definition.class.name : nil,
  }
end