Class: WSDL::Reader::Messages

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

Instance Method Summary collapse

Methods inherited from Hash

#keys_to_sym!, #kvTable

Instance Method Details

#lookup_messages_by_element(element_name) ⇒ Object



24
25
26
27
28
# File 'lib/wsdl-reader/message.rb', line 24

def lookup_messages_by_element(element_name)
  values.select do |message|
    message.parts.values.find { |part| part[:element].split(':').last == element_name }
  end
end

#lookup_operation_by_element!(type, element_name, port_types) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wsdl-reader/message.rb', line 12

def lookup_operation_by_element! (type, element_name, port_types)
  messages = lookup_operations_by_element type, element_name, port_types
  case messages.size
    when 1
      messages.first
    when 0
      raise OperationNotFoundError.new type, element_name
    else
      raise ManyOperationsFoundError.new type, element_name
  end
end

#lookup_operations_by_element(type, element_name, port_types) ⇒ Object



5
6
7
8
9
10
# File 'lib/wsdl-reader/message.rb', line 5

def lookup_operations_by_element(type, element_name, port_types)
  messages = lookup_messages_by_element(element_name)
  messages.map do |message|
    port_types.lookup_operations_by_message(type, message)
  end.flatten
end