Class: WSDL::Parser::DocumentCollection Private
- Inherits:
-
Object
- Object
- WSDL::Parser::DocumentCollection
- Includes:
- Enumerable
- Defined in:
- lib/wsdl/parser/document_collection.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A collection of parsed WSDL documents.
This class aggregates multiple WSDL documents that may be imported from a single root WSDL. It provides unified access to messages, port types, bindings, and services across all imported documents.
Instance Method Summary collapse
-
#<<(document) ⇒ Array<Document>
private
Adds a document to the collection.
-
#bindings ⇒ Hash{QName => Binding}
private
Returns all bindings from all documents in the collection.
-
#each {|document| ... } ⇒ Enumerator, Array
private
Iterates over each document in the collection.
-
#initialize ⇒ DocumentCollection
constructor
private
Creates a new empty DocumentCollection.
-
#messages ⇒ Hash{QName => MessageInfo}
private
Returns all messages from all documents in the collection.
-
#port_types ⇒ Hash{QName => PortType}
private
Returns all port types from all documents in the collection.
-
#seal! ⇒ DocumentCollection
private
Seals this collection against further mutation.
-
#sealed? ⇒ Boolean
private
Returns whether this collection is sealed against mutation.
-
#service_name ⇒ String
private
Returns the service name from the first (root) document.
-
#service_port(service_name, port_name) ⇒ Port
private
Returns a port by service and port name.
-
#services ⇒ Hash{String => Service}
private
Returns all services from all documents in the collection.
Constructor Details
#initialize ⇒ DocumentCollection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new empty DocumentCollection.
17 18 19 20 |
# File 'lib/wsdl/parser/document_collection.rb', line 17 def initialize @documents = [] @sealed = false end |
Instance Method Details
#<<(document) ⇒ Array<Document>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds a document to the collection.
27 28 29 30 31 32 33 34 |
# File 'lib/wsdl/parser/document_collection.rb', line 27 def <<(document) if sealed? raise SealedCollectionError, 'Cannot add documents after import has completed and the collection is sealed.' end @documents << document end |
#bindings ⇒ Hash{QName => Binding}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns all bindings from all documents in the collection.
69 70 71 |
# File 'lib/wsdl/parser/document_collection.rb', line 69 def bindings @bindings ||= collect_sections(:binding, &:bindings) end |
#each {|document| ... } ⇒ Enumerator, Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Iterates over each document in the collection.
41 42 43 |
# File 'lib/wsdl/parser/document_collection.rb', line 41 def each(&) @documents.each(&) end |
#messages ⇒ Hash{QName => MessageInfo}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns all messages from all documents in the collection.
55 56 57 |
# File 'lib/wsdl/parser/document_collection.rb', line 55 def ||= collect_sections(:message, &:messages) end |
#port_types ⇒ Hash{QName => PortType}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns all port types from all documents in the collection.
62 63 64 |
# File 'lib/wsdl/parser/document_collection.rb', line 62 def port_types @port_types ||= collect_sections(:port_type, &:port_types) end |
#seal! ⇒ DocumentCollection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Seals this collection against further mutation.
94 95 96 97 |
# File 'lib/wsdl/parser/document_collection.rb', line 94 def seal! @sealed = true self end |
#sealed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns whether this collection is sealed against mutation.
102 103 104 |
# File 'lib/wsdl/parser/document_collection.rb', line 102 def sealed? @sealed end |
#service_name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the service name from the first (root) document.
48 49 50 |
# File 'lib/wsdl/parser/document_collection.rb', line 48 def service_name @service_name ||= first.service_name end |
#service_port(service_name, port_name) ⇒ Port
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a port by service and port name.
86 87 88 89 |
# File 'lib/wsdl/parser/document_collection.rb', line 86 def service_port(service_name, port_name) service = services.fetch(service_name) service.ports.fetch(port_name) end |
#services ⇒ Hash{String => Service}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns all services from all documents in the collection.
76 77 78 |
# File 'lib/wsdl/parser/document_collection.rb', line 76 def services @services ||= collect_sections(:service, &:services) end |