Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • soap/mapping/factory.rb

Class/Module Index [+]

Quicksearch

SOAP::Mapping::ArrayFactory_

Public Class Methods

new(allow_original_mapping = false) click to toggle source
 
               # File soap/mapping/factory.rb, line 206
def initialize(allow_original_mapping = false)
  super()
  @allow_original_mapping = allow_original_mapping
end
            

Public Instance Methods

obj2soap(soap_class, obj, info, map) click to toggle source
[1], [2]

is converted to Array of Array, not 2-D Array.

To create M-D Array, you must call SOAP::Mapping.ary2md.

 
               # File soap/mapping/factory.rb, line 213
def obj2soap(soap_class, obj, info, map)
  if !@allow_original_mapping and !obj.instance_variables.empty?
    return nil
  end
  arytype = Mapping.obj2element(obj)
  if arytype.name
    arytype.namespace ||= RubyTypeNamespace
  else
    arytype = XSD::AnyTypeName
  end
  soap_obj = SOAPArray.new(ValueArrayName, 1, arytype)
  mark_marshalled_obj(obj, soap_obj)
  obj.each do |item|
    soap_obj.add(Mapping._obj2soap(item, map))
  end
  soap_obj
end
            
soap2obj(obj_class, node, info, map) click to toggle source
 
               # File soap/mapping/factory.rb, line 231
def soap2obj(obj_class, node, info, map)
  obj = Mapping.create_empty_object(obj_class)
  mark_unmarshalled_obj(node, obj)
  node.soap2array(obj) do |elem|
    elem ? Mapping._soap2obj(elem, map) : nil
  end
  return true, obj
end