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.



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

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.



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

def name
  @name
end

#operationsObject (readonly)

Returns the value of attribute operations.



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

def operations
  @operations
end

#styleObject (readonly)

Returns the value of attribute style.



35
36
37
# File 'lib/wsdl-reader/binding.rb', line 35

def style
  @style
end

#transportObject (readonly)

Returns the value of attribute transport.



36
37
38
# File 'lib/wsdl-reader/binding.rb', line 36

def transport
  @transport
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#operation?(name) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/wsdl-reader/binding.rb', line 63

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