From: Alex Polite Date: 2006-05-27T04:24:36+09:00 Subject: Re: Marshaling NArray objects. On 5/25/06, ara.t.howard@noaa.gov wrote: > > are you sure need it? yeah. I'm marshaling objects that have narrays as a component among others. > > harp:~ > cat a.rb > require 'narray' > > class NArray > def _dump *ignored > Marshal.dump :typecode => typecode, :shape => shape, :data => to_s > end > def self._load buf > h = Marshal.load buf > typecode = h[:typecode] > shape = h[:shape] > data = h[:data] > to_na data, typecode, *shape > end > end > Thanks a bunch. That did the trick. Just one more thing. When I load a marshalled object I can access the attributes on that object but I can call it's methods. This is from irb. I've googled for stuff like "marshaling methods" to no avail. Alex -- Alex Polite http://flosspick.org - finding the right open source