Class: SOAP::Mapping::Factory

Inherits:
Object
  • Object
show all
Includes:
TraverseSupport
Defined in:
lib/soap/mapping/factory.rb

Instance Method Summary collapse

Methods included from TraverseSupport

#mark_marshalled_obj, #mark_unmarshalled_obj

Constructor Details

#initializeFactory

Returns a new instance of Factory.


17
18
19
# File 'lib/soap/mapping/factory.rb', line 17

def initialize  # nothing to do

end

Instance Method Details

#obj2soap(soap_class, obj, info, map) ⇒ Object

Raises:

  • (NotImplementError)

21
22
23
24
# File 'lib/soap/mapping/factory.rb', line 21

def obj2soap(soap_class, obj, info, map)
  raise NotImplementError.new  # return soap_obj

end

#setiv2obj(obj, node, map) ⇒ Object


31
32
33
34
35
36
37
38
# File 'lib/soap/mapping/factory.rb', line 31

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


40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/soap/mapping/factory.rb', line 40

def setiv2soap(node, obj, map)
  if obj.class.class_variable_defined?('@@schema_element')
    setdefinediv2soap(node, obj, map)
  else
    # should we sort instance_variables? how?
    obj.instance_variables.each do |var|
      name = var.to_s.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

Raises:

  • (NotImplementError)

26
27
28
29
# File 'lib/soap/mapping/factory.rb', line 26

def soap2obj(obj_class, node, info, map)
  raise NotImplementError.new  # return convert_succeeded_or_not, obj

end