Class: WSDL::Reader::Bindings

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

Instance Method Summary collapse

Methods inherited from Hash

#keys_to_sym!, #kvTable

Instance Method Details

#all_operationsObject



22
23
24
# File 'lib/wsdl-reader/binding.rb', line 22

def all_operations
  self.map { |_, binding| binding.operations.values }.flatten
end

#get_binding_for_operation_name(binding_name = nil, operation_name) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/wsdl-reader/binding.rb', line 4

def get_binding_for_operation_name(binding_name = nil, operation_name)
  if binding_name.nil?
    self.map do |_, binding|
      binding if binding.operation?(operation_name)
    end.flatten
  else
    [self[binding_name]] if self[binding_name].operation?(operation_name)
  end
end

#get_operations(binding_name = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/wsdl-reader/binding.rb', line 14

def get_operations(binding_name = nil)
  if binding_name.nil?
    all_operations
  else
    self[binding_name].operations.keys
  end
end

#operation?(operation_name) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/wsdl-reader/binding.rb', line 33

def operation?(operation_name)
  any? { |_, binding| binding.operation? operation_name }
end

#operations(binding = nil) ⇒ Object



26
27
28
29
30
31
# File 'lib/wsdl-reader/binding.rb', line 26

def operations(binding=nil)
  bindings = binding.nil? ? self : ({ a: self[binding] })
  bindings.inject({ }) do |hash, (_, b)|
    hash.merge b.operations
  end
end