Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1931

Show
Ignore:
Timestamp:
08/31/07 23:17:57 (1 year ago)
Author:
nahi
Message:
  • allow the Fixnum which have an instance variable to be marshalled. For Fixnum, ivars are not marshalled but allowed to be marshalled in Ruby's marshal. closes #406
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/mapping/encodedregistry.rb

    r1930 r1931  
    124124  StringFactory = StringFactory_.new 
    125125  BasetypeFactory = BasetypeFactory_.new 
     126  FixnumFactory = FixnumFactory_.new 
    126127  DateTimeFactory = DateTimeFactory_.new 
    127128  ArrayFactory = ArrayFactory_.new 
     
    147148    [::Float,        ::SOAP::SOAPFloat,      BasetypeFactory, 
    148149      {:derived_class => true}], 
     150    [::Fixnum,       ::SOAP::SOAPInt,        FixnumFactory], 
    149151    [::Integer,      ::SOAP::SOAPInt,        BasetypeFactory, 
    150152      {:derived_class => true}], 
     
    210212    [::Float,        ::SOAP::SOAPFloat,      BasetypeFactory, 
    211213      {:derived_class => true}], 
     214    [::Fixnum,       ::SOAP::SOAPInt,        FixnumFactory], 
    212215    [::Integer,      ::SOAP::SOAPInt,        BasetypeFactory, 
    213216      {:derived_class => true}], 
  • trunk/lib/soap/mapping/factory.rb

    r1925 r1931  
    126126end 
    127127 
     128class FixnumFactory_ < Factory 
     129  def obj2soap(soap_class, obj, info, map) 
     130    soap_obj = nil 
     131    begin 
     132      soap_obj = soap_class.new(obj) 
     133    rescue XSD::ValueSpaceError 
     134      return nil 
     135    end 
     136    soap_obj 
     137  end 
     138 
     139  def soap2obj(obj_class, node, info, map) 
     140    obj = node.data 
     141    return true, obj 
     142  end 
     143end 
     144 
    128145class BasetypeFactory_ < Factory 
    129146  def initialize(allow_original_mapping = false)