Class: WSDL::Contract::MessageContract

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/contract/message_contract.rb

Overview

Immutable request/response message contract.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header:, body:) ⇒ MessageContract

Returns a new instance of MessageContract.

Parameters:



9
10
11
12
13
# File 'lib/wsdl/contract/message_contract.rb', line 9

def initialize(header:, body:)
  @header = header
  @body = body
  freeze
end

Instance Attribute Details

#bodyPartContract (readonly)

Returns:



19
20
21
# File 'lib/wsdl/contract/message_contract.rb', line 19

def body
  @body
end

#headerPartContract (readonly)

Returns:



16
17
18
# File 'lib/wsdl/contract/message_contract.rb', line 16

def header
  @header
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/wsdl/contract/message_contract.rb', line 22

def empty?
  @header.paths.empty? && @body.paths.empty?
end