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.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/wsdl-reader/binding.rb', line 34

def initialize(element)
  @operations = Hash.new
  @name       = element.attributes['name']
  @type       = element.attributes['type'] # because of Object#type
  @style      = nil
  @transport  = nil

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

      when "operation"
        store_operation_name(element, operation)

        operation.find_all { |e| e.class == REXML::Element }.each { |action|
          store_action(action, element, operation)
        }
      else
        warn "Ignoring element `#{operation.name}' in binding `#{element.attributes['name']}'"
    end
  }
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#operationsObject (readonly)

Returns the value of attribute operations.



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

def operations
  @operations
end

#styleObject (readonly)

Returns the value of attribute style.



31
32
33
# File 'lib/wsdl-reader/binding.rb', line 31

def style
  @style
end

#transportObject (readonly)

Returns the value of attribute transport.



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

def transport
  @transport
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#operation?(name) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/wsdl-reader/binding.rb', line 59

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