Class: WsdlMapper::Dom::ComplexType

Inherits:
TypeBase
  • Object
show all
Defined in:
lib/wsdl_mapper/dom/complex_type.rb

Instance Attribute Summary collapse

Attributes inherited from TypeBase

#documentation, #name

Instance Method Summary collapse

Methods inherited from TypeBase

#==, #eql?, #hash, to_proc

Constructor Details

#initialize(name) ⇒ ComplexType

Returns a new instance of ComplexType.



10
11
12
13
14
15
16
17
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 10

def initialize(name)
  super
  @properties = {}
  @attributes = {}
  @simple_content = false
  @soap_array = false
  @base = nil
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



6
7
8
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 6

def attributes
  @attributes
end

#baseObject

Returns the value of attribute base.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def base
  @base
end

#base_type_nameObject

Returns the value of attribute base_type_name.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def base_type_name
  @base_type_name
end

#containing_elementObject

Returns the value of attribute containing_element.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def containing_element
  @containing_element
end

#containing_propertyObject

Returns the value of attribute containing_property.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def containing_property
  @containing_property
end

#propertiesObject (readonly)

Returns the value of attribute properties.



6
7
8
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 6

def properties
  @properties
end

#simple_contentObject

Returns the value of attribute simple_content.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def simple_content
  @simple_content
end

#soap_arrayObject

Returns the value of attribute soap_array.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def soap_array
  @soap_array
end

#soap_array_typeObject

Returns the value of attribute soap_array_type.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def soap_array_type
  @soap_array_type
end

#soap_array_type_nameObject

Returns the value of attribute soap_array_type_name.



7
8
9
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 7

def soap_array_type_name
  @soap_array_type_name
end

Instance Method Details

#add_attribute(attribute) ⇒ Object



19
20
21
22
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 19

def add_attribute(attribute)
  attribute.containing_type = self
  @attributes[attribute.name] = attribute
end

#add_property(property) ⇒ Object



24
25
26
27
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 24

def add_property(property)
  property.containing_type = self
  @properties[property.name] = property
end

#basesObject



55
56
57
58
59
60
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 55

def bases
  # TODO: test
  return [] unless @base

  [*@base.bases, @base]
end

#each_attribute(&block) ⇒ Object



39
40
41
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 39

def each_attribute(&block)
  attributes.values.each(&block)
end

#each_property(&block) ⇒ Object



29
30
31
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 29

def each_property(&block)
  properties.values.each(&block)
end

#each_property_with_bases(&block) ⇒ Object



33
34
35
36
37
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 33

def each_property_with_bases(&block)
  [*bases, self].inject([]) do |arr, type|
    arr + type.each_property.to_a
  end.each(&block)
end

#rootObject



51
52
53
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 51

def root
  @base ? @base.root : self
end

#simple_content?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 43

def simple_content?
  !!@simple_content
end

#soap_array?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/wsdl_mapper/dom/complex_type.rb', line 47

def soap_array?
  !!@soap_array
end