Class: SOAP::Mapping::Factory

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

Direct Known Subclasses

ArrayFactory_, AttachmentFactory, Base64Factory_, BasetypeFactory_, DateTimeFactory_, FixnumFactory_, HashFactory_, RubytypeFactory, StringFactory_, TypedArrayFactory_, TypedStructFactory_, URIFactory_

Instance Method Summary (collapse)

Methods included from TraverseSupport

#mark_marshalled_obj, #mark_unmarshalled_obj

Constructor Details

- (Factory) initialize



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

def initialize
  # nothing to do
end

Instance Method Details

- (Object) obj2soap(soap_class, obj, info, map)

Raises:

  • (NotImplementError)


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

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

- (Object) setiv2obj(obj, node, map)



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

- (Object) setiv2soap(node, obj, map)



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

def setiv2soap(node, obj, map)
  if obj.class.class_variables.include?(:@@schema_element)
    setdefinediv2soap(node, obj, map)
  else
    # should we sort instance_variables? how?
    obj.instance_variables.each do |var|
      name = var.to_s.sub(/^@/, '').to_sym
      elename = Mapping.name2elename(name)
      node.add(elename,
        Mapping._obj2soap(obj.instance_variable_get(var), map))
    end
  end
end

- (Object) soap2obj(obj_class, node, info, map)

Raises:

  • (NotImplementError)


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

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