Class: WSDL::Reader::PortType

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl-reader/port_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ PortType

Returns a new instance of PortType.



22
23
24
25
26
27
# File 'lib/wsdl-reader/port_type.rb', line 22

def initialize(element)
  @operations = Hash.new
  @name       = element.attributes['name']

  process_all_operations(element)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/wsdl-reader/port_type.rb', line 20

def name
  @name
end

#operationsObject (readonly)

Returns the value of attribute operations.



19
20
21
# File 'lib/wsdl-reader/port_type.rb', line 19

def operations
  @operations
end

Instance Method Details

#lookup_operation_message(type, operation, messages) ⇒ Object



29
30
31
32
# File 'lib/wsdl-reader/port_type.rb', line 29

def lookup_operation_message(type, operation, messages)
  operation_name = operation.is_a?(Operation) ? operation.name : operation.to_s
  messages[@operations[operation_name][type][:message].split(':').last]
end

#lookup_operations_by_message(type, message) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/wsdl-reader/port_type.rb', line 34

def lookup_operations_by_message(type, message)
  ops = @operations.values.select do |operation|
    operation_message? type, operation, message
  end
  ops.map do |operation_hash|
    operation_hash[:name]
  end
end

#operation_message?(type, operation, message) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
46
47
# File 'lib/wsdl-reader/port_type.rb', line 43

def operation_message?(type, operation, message)
  message_name = message.is_a?(Message) ? message.name : message.to_s
  operation[type][:message] == message_name ||
      operation[type][:message].split(':').last == message_name
end