Class: LolSoap::WSDL::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/lolsoap/wsdl/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wsdl, name, namespace, elements) ⇒ Type

Returns a new instance of Type.



5
6
7
8
9
10
# File 'lib/lolsoap/wsdl/type.rb', line 5

def initialize(wsdl, name, namespace, elements)
  @wsdl      = wsdl
  @name      = name
  @namespace = namespace
  @elements  = elements
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/lolsoap/wsdl/type.rb', line 3

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



3
4
5
# File 'lib/lolsoap/wsdl/type.rb', line 3

def namespace
  @namespace
end

Instance Method Details

#element(name) ⇒ Object



16
17
18
# File 'lib/lolsoap/wsdl/type.rb', line 16

def element(name)
  @elements.fetch(name) { NullElement.new }
end

#elementsObject



12
13
14
# File 'lib/lolsoap/wsdl/type.rb', line 12

def elements
  @elements.dup
end

#inspectObject



28
29
30
31
32
# File 'lib/lolsoap/wsdl/type.rb', line 28

def inspect
  "<#{self.class} " \
  "name=#{(prefix + ':' + name).inspect} " \
  "elements=#{elements.inspect}>"
end

#prefixObject



24
25
26
# File 'lib/lolsoap/wsdl/type.rb', line 24

def prefix
  wsdl.prefixes[namespace]
end

#sub_type(name) ⇒ Object



20
21
22
# File 'lib/lolsoap/wsdl/type.rb', line 20

def sub_type(name)
  element(name).type
end