Method: XSD::Schema#import_map_children

Defined in:
lib/xsd/objects/schema.rb

#import_map_children(name, cache) ⇒ Object

Get children from all loaded schemas

Parameters:

  • name (Symbol)


143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/xsd/objects/schema.rb', line 143

def import_map_children(name, cache)
  return [] if %i[import include].include?(name.to_sym)

  (includes + imports).map do |import|
    key = import.respond_to?(:namespace) && import.namespace ? import.namespace : import.schema_location
    if cache.key?(key)
      nil
    else
      cache[key] = true
      import.imported_schema.map_children(name, cache)
    end
  end.compact.flatten
end