Class: WSDL::Definition::Builder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/definition/builder.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.

Constructs a frozen WSDL::Definition from parsed WSDL data.

Walks the parsed WSDL documents and schemas to enumerate all services, ports, and operations. For each operation, resolves message references and converts element trees to plain hashes via XML::Element#to_definition_h.

API:

  • private

Constant Summary collapse

SCHEMA_VERSION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Schema version for serialized Definitions. Bump when the internal hash structure changes.

Returns:

API:

  • private

1
EMPTY_MESSAGE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Empty message placeholder for operations whose element resolution fails.

Returns:

API:

  • private

{ header: [], body: [] }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(documents:, schemas:, limits:, provenance:, schema_import_errors:) ⇒ Builder

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 Builder.

Parameters:

  • parsed WSDL documents

  • parsed XML schemas

  • resource limits

  • source provenance from import

  • recoverable schema import errors

API:

  • private



34
35
36
37
38
39
40
# File 'lib/wsdl/definition/builder.rb', line 34

def initialize(documents:, schemas:, limits:, provenance:, schema_import_errors:)
  @documents = documents
  @schemas = schemas
  @limits = limits
  @provenance = provenance
  @schema_import_errors = schema_import_errors
end

Instance Method Details

#buildDefinition

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.

Builds and returns a frozen WSDL::Definition.

Returns:

  • the frozen definition

API:

  • private



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/wsdl/definition/builder.rb', line 45

def build
  @build_issues = []

  sources = @provenance.map(&:freeze).freeze
  services = build_services

  data = {
    schema_version: SCHEMA_VERSION,
    service_name: @documents.service_name,
    sources:,
    build_issues: @build_issues.freeze,
    services:,
    fingerprint: compute_fingerprint(sources)
  }

  Definition.new(data)
end