Class: WSDL::Request::Envelope

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/request/envelope.rb

Overview

Root node of the request envelope.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvelope

Returns a new instance of Envelope.



7
8
9
10
11
12
# File 'lib/wsdl/request/envelope.rb', line 7

def initialize
  @header = []
  @body = []
  @namespace_decls = []
  @annotations = []
end

Instance Attribute Details

#annotationsArray<Hash{Symbol => Object}> (readonly)

Returns:

  • (Array<Hash{Symbol => Object}>)


24
25
26
# File 'lib/wsdl/request/envelope.rb', line 24

def annotations
  @annotations
end

#bodyArray<Node> (readonly)

Returns:



18
19
20
# File 'lib/wsdl/request/envelope.rb', line 18

def body
  @body
end

#headerArray<Node> (readonly)

Returns:



15
16
17
# File 'lib/wsdl/request/envelope.rb', line 15

def header
  @header
end

#namespace_declsArray<NamespaceDecl> (readonly)

Returns:



21
22
23
# File 'lib/wsdl/request/envelope.rb', line 21

def namespace_decls
  @namespace_decls
end

Instance Method Details

#namespace_uri_for(prefix) ⇒ String?

Returns namespace URI for a given prefix.

Parameters:

  • prefix (String)

Returns:

  • (String, nil)


30
31
32
33
# File 'lib/wsdl/request/envelope.rb', line 30

def namespace_uri_for(prefix)
  decl = @namespace_decls.find { |d| d.prefix == prefix }
  decl&.uri
end

#namespaces_hashHash{String => String}

Returns a Hash representation of namespace declarations.

Returns:

  • (Hash{String => String})


38
39
40
# File 'lib/wsdl/request/envelope.rb', line 38

def namespaces_hash
  @namespace_decls.to_h { |decl| [decl.prefix || '', decl.uri] }
end