Class: WSDL::XMLSchema::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/xmlSchema/importer.rb

Direct Known Subclasses

Importer

Constant Summary collapse

DO_NOT_IMPORT =
[::SOAP::EncodingNamespace]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImporter

Returns a new instance of Importer.



25
26
27
# File 'lib/wsdl/xmlSchema/importer.rb', line 25

def initialize
  @web_client = nil
end

Class Method Details

.import(location, originalroot = nil) ⇒ Object



21
22
23
# File 'lib/wsdl/xmlSchema/importer.rb', line 21

def self.import(location, originalroot = nil)
  new.import(location, originalroot)
end

Instance Method Details

#import(location, originalroot = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/wsdl/xmlSchema/importer.rb', line 29

def import(location, originalroot = nil)
  if DO_NOT_IMPORT.include?(location.to_s)
    return nil
  end
  unless location.is_a?(URI)
    location = URI.parse(location)
  end
  source, normalizedlocation = fetch(location)
  content = parse(source, normalizedlocation, originalroot)
  content.location = normalizedlocation
  content
end