Class: WSDL::Reader::Binding

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Binding

Returns a new instance of Binding.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/wsdl-reader/binding.rb', line 46

def initialize(element)
  @operations = Operations.new
  @name       = element.attributes['name']
  @type       = element.attributes['type'] # because of Object#type
  @type_nns   = @type.split(':').last rescue @type
  @style      = nil
  @transport  = nil

  # Process all binding and operation
  element.find_all { |e| e.class == REXML::Element }.each do |operation_element|
    case operation_element.name
      when "binding" # soap:binding
        store_style_and_transport(operation_element)

      when "operation"
        append_operation(operation_element)
      else
        warn "Ignoring element `#{operation.name}' in binding `#{element.attributes['name']}'"
    end
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'lib/wsdl-reader/binding.rb', line 40

def name
  @name
end

#operationsObject (readonly)

Returns the value of attribute operations.



39
40
41
# File 'lib/wsdl-reader/binding.rb', line 39

def operations
  @operations
end

#styleObject (readonly)

Returns the value of attribute style.



43
44
45
# File 'lib/wsdl-reader/binding.rb', line 43

def style
  @style
end

#transportObject (readonly)

Returns the value of attribute transport.



44
45
46
# File 'lib/wsdl-reader/binding.rb', line 44

def transport
  @transport
end

#typeObject (readonly)

Returns the value of attribute type.



41
42
43
# File 'lib/wsdl-reader/binding.rb', line 41

def type
  @type
end

#type_nnsObject (readonly)

Returns the value of attribute type_nns.



42
43
44
# File 'lib/wsdl-reader/binding.rb', line 42

def type_nns
  @type_nns
end

Instance Method Details

#lookup_port_type(port_types) ⇒ Object



72
73
74
# File 'lib/wsdl-reader/binding.rb', line 72

def lookup_port_type(port_types)
  port_types[type.split(':').last]
end

#operation?(name) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/wsdl-reader/binding.rb', line 68

def operation?(name)
  operations.include? camelize_operation(name)
end