class XsdModel::Elements::Schema

Attributes

source[RW]

Public Class Methods

new(*args, attributes: {}, namespaces: {}, css_path: '') click to toggle source
Calls superclass method XsdModel::Elements::BaseElement::new
# File lib/xsd_model/elements/schema.rb, line 10
def initialize(*args, attributes: {}, namespaces: {}, css_path: '')
  super
  @source = '(initial)'
end

Public Instance Methods

_collect_imported_schemas(original_schema, options, already_collected = []) click to toggle source
# File lib/xsd_model/elements/schema.rb, line 19
def _collect_imported_schemas(original_schema, options, already_collected = [])
  imports = original_schema.imports

  imports.each do |import|
    unless already_collected.map { |d| d.target_namespace }.include? import.namespace
      new_schema = import.load(options)
      already_collected << new_schema
      _collect_imported_schemas(new_schema, options, already_collected)
    end
  end

  already_collected
end
_collect_included_schemas(original_schema, options, collected_schemas = [], collected_paths = []) click to toggle source
# File lib/xsd_model/elements/schema.rb, line 37
def _collect_included_schemas(original_schema, options, collected_schemas = [], collected_paths = [])
  includes = original_schema.includes

  includes.each do |incl|
    unless collected_paths.include? incl.schema_location
      new_schema = incl.load(options)
      collected_schemas << new_schema
      collected_paths << incl.schema_location

      _collect_included_schemas(new_schema, options, collected_schemas, collected_paths)
    end
  end

  collected_schemas
end
collect_imported_schemas(options = {}) click to toggle source
# File lib/xsd_model/elements/schema.rb, line 15
def collect_imported_schemas(options = {})
  _collect_imported_schemas(self, options)
end
collect_included_schemas(options = {}) click to toggle source
# File lib/xsd_model/elements/schema.rb, line 33
def collect_included_schemas(options = {})
  _collect_included_schemas(self, options)
end