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

Changeset 1706

Show
Ignore:
Timestamp:
09/02/06 00:19:21 (2 years ago)
Author:
nahi
Message:

[1.9 support] fixed anonymous class handling. closes #242.

Files:

Legend:

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

    r1705 r1706  
    8989    Mapping.set_attributes(obj, vars) 
    9090  end 
     91 
     92  def anonymous_class?(obj) 
     93    name = obj.class.name 
     94    name.nil? or name.empty?    # 1.8 returns "" 
     95  end 
    9196end 
    9297 
  • trunk/lib/soap/mapping/registry.rb

    r1683 r1706  
    524524    unless list.empty? 
    525525      node.extraattr[RubyExtendName] = list.collect { |c| 
    526         if c.name.empty? 
     526        name = c.name 
     527        if name.nil? or name.empty? 
    527528          raise TypeError.new("singleton can't be dumped #{ obj }") 
    528529        end 
    529         c.name 
     530        name 
    530531      }.join(" ") 
    531532    end 
  • trunk/lib/soap/mapping/rubytypeFactory.rb

    r1555 r1706  
    263263 
    264264  def unknownobj2soap(soap_class, obj, info, map) 
    265     if obj.class.name.empty? 
     265    if anonymous_class?(obj) 
    266266      raise TypeError.new("can't dump anonymous class #{obj}") 
    267267    end