Class: SOAP::Mapping::Factory
Direct Known Subclasses
ArrayFactory_, AttachmentFactory, Base64Factory_, BasetypeFactory_, DateTimeFactory_, HashFactory_, RubytypeFactory, StringFactory_, TypedArrayFactory_, TypedStructFactory_, URIFactory_
Instance Method Summary
collapse
-
#initialize ⇒ Factory
constructor
A new instance of Factory.
-
#obj2soap(soap_class, obj, info, map) ⇒ Object
-
#setiv2obj(obj, node, map) ⇒ Object
-
#setiv2soap(node, obj, map) ⇒ Object
-
#soap2obj(obj_class, node, info, map) ⇒ Object
#mark_marshalled_obj, #mark_unmarshalled_obj
Constructor Details
Returns a new instance of Factory.
16
17
18
|
# File 'lib/soap/mapping/factory.rb', line 16
def initialize
end
|
Instance Method Details
#obj2soap(soap_class, obj, info, map) ⇒ Object
20
21
22
23
|
# File 'lib/soap/mapping/factory.rb', line 20
def obj2soap(soap_class, obj, info, map)
raise NotImplementError.new
end
|
#setiv2obj(obj, node, map) ⇒ Object
30
31
32
33
34
35
36
37
|
# File 'lib/soap/mapping/factory.rb', line 30
def setiv2obj(obj, node, map)
return if node.nil?
if obj.is_a?(Array)
setiv2ary(obj, node, map)
else
setiv2struct(obj, node, map)
end
end
|
#setiv2soap(node, obj, map) ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/soap/mapping/factory.rb', line 39
def setiv2soap(node, obj, map)
if obj.class.class_variables.include?('@@schema_element')
obj.class.class_eval('@@schema_element').each do |name, info|
type, qname = info
if qname
elename = qname.name
else
elename = Mapping.name2elename(name)
end
node.add(elename,
Mapping._obj2soap(obj.instance_variable_get('@' + name), map))
end
else
obj.instance_variables.each do |var|
name = var.sub(/^@/, '')
elename = Mapping.name2elename(name)
node.add(elename,
Mapping._obj2soap(obj.instance_variable_get(var), map))
end
end
end
|
#soap2obj(obj_class, node, info, map) ⇒ Object
25
26
27
28
|
# File 'lib/soap/mapping/factory.rb', line 25
def soap2obj(obj_class, node, info, map)
raise NotImplementError.new
end
|