Class: Lutaml::Xsd::SchemaClassificationInfo
- Inherits:
-
Object
- Object
- Lutaml::Xsd::SchemaClassificationInfo
- Defined in:
- lib/lutaml/xsd/schema_classifier.rb
Overview
Value object for schema classification info
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#elements_count ⇒ Object
readonly
Returns the value of attribute elements_count.
-
#external_refs ⇒ Object
readonly
Returns the value of attribute external_refs.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#resolution_status ⇒ Object
readonly
Returns the value of attribute resolution_status.
-
#types_count ⇒ Object
readonly
Returns the value of attribute types_count.
Instance Method Summary collapse
-
#fully_resolved? ⇒ Boolean
Check if schema is fully resolved.
-
#initialize(schema:, location:, category:) ⇒ SchemaClassificationInfo
constructor
A new instance of SchemaClassificationInfo.
-
#partially_resolved? ⇒ Boolean
Check if schema is partially resolved.
-
#to_h ⇒ Hash
Convert to hash representation.
Constructor Details
#initialize(schema:, location:, category:) ⇒ SchemaClassificationInfo
Returns a new instance of SchemaClassificationInfo.
158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 158 def initialize(schema:, location:, category:) @location = location @category = category @namespace = schema.target_namespace @elements_count = schema.element.size @complex_types_count = schema.complex_type.size @simple_types_count = schema.simple_type.size @types_count = @complex_types_count + @simple_types_count @imports_count = schema.import.size @includes_count = schema.include.size @external_refs = extract_external_references(schema) @resolution_status = determine_resolution_status end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def category @category end |
#elements_count ⇒ Object (readonly)
Returns the value of attribute elements_count.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def elements_count @elements_count end |
#external_refs ⇒ Object (readonly)
Returns the value of attribute external_refs.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def external_refs @external_refs end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def location @location end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def namespace @namespace end |
#resolution_status ⇒ Object (readonly)
Returns the value of attribute resolution_status.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def resolution_status @resolution_status end |
#types_count ⇒ Object (readonly)
Returns the value of attribute types_count.
155 156 157 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 155 def types_count @types_count end |
Instance Method Details
#fully_resolved? ⇒ Boolean
Check if schema is fully resolved
174 175 176 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 174 def fully_resolved? @resolution_status == :fully_resolved end |
#partially_resolved? ⇒ Boolean
Check if schema is partially resolved
180 181 182 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 180 def partially_resolved? @resolution_status == :partially_resolved end |
#to_h ⇒ Hash
Convert to hash representation
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/lutaml/xsd/schema_classifier.rb', line 186 def to_h { location: @location, filename: File.basename(@location), category: @category, namespace: @namespace || "(no namespace)", elements_count: @elements_count, types_count: @types_count, complex_types_count: @complex_types_count, simple_types_count: @simple_types_count, imports_count: @imports_count, includes_count: @includes_count, resolution_status: @resolution_status, external_refs_count: @external_refs.size, } end |