File: struct.rb

package info (click to toggle)
soap4r 1.4.8-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,472 kB
  • ctags: 2,206
  • sloc: ruby: 19,295; makefile: 58; sh: 41; perl: 10
file content (18 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'soap/marshal'

Foo1 = Struct.new( "Foo1", :m )
Foo2 = Struct.new( :m )
class Foo3
  attr_accessor :m
end

puts SOAP::Marshal.marshal( Foo1.new )
puts SOAP::Marshal.marshal( Foo2.new )
puts SOAP::Marshal.marshal( Foo3.new )

p SOAP::Marshal.unmarshal( SOAP::Marshal.marshal( Foo1.new ))
  # => #<Struct::Foo1 m=nil>
p SOAP::Marshal.unmarshal( SOAP::Marshal.marshal( Foo2.new ))
  # => #<Foo2 m=nil>
p SOAP::Marshal.unmarshal( SOAP::Marshal.marshal( Foo3.new ))
  # => #<Foo3:0xa033fc0>