Fuel - How to ignore instances of a class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fuel - How to ignore instances of a class

Bernat Romagosa
Hi list,

I read in the documentation of Fuel that you can implement #fuelAccept: to prevent instances of a class from being serialized, but what I'd like is to ignore those instances, not to raise an error when trying to serialize them.

I tried with a visitSubstitution by nil, but it brought big trouble after serializing, materializing and trying to serialize again.

Thanks!

p.s. Using fuel 1.8.1 loaded from the latest configuration in ss3.

--
Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: Fuel - How to ignore instances of a class

Mariano Martinez Peck


On Fri, Jan 4, 2013 at 9:42 AM, Bernat Romagosa <[hidden email]> wrote:
Hi list,

I read in the documentation of Fuel that you can implement #fuelAccept: to prevent instances of a class from being serialized, but what I'd like is to ignore those instances, not to raise an error when trying to serialize them.

I tried with a visitSubstitution by nil, but it brought big trouble after serializing, materializing and trying to serialize again.


Hi Bernat. That should be the way I would do it. Which are the problems?

MyClass >> fuelAccept: aGeneralMapper
    ^ aGeneralMapper visitSubstitution: self by: nil

 
Thanks!

p.s. Using fuel 1.8.1 loaded from the latest configuration in ss3.

--
Bernat Romagosa.



--
Mariano
http://marianopeck.wordpress.com
Reply | Threaded
Open this post in threaded view
|

Re: Fuel - How to ignore instances of a class

Bernat Romagosa
None right now.. I don't understand what happened a while ago. It's working now, I'll come back if it happens again.

Thanks! :)


2013/1/4 Mariano Martinez Peck <[hidden email]>


On Fri, Jan 4, 2013 at 9:42 AM, Bernat Romagosa <[hidden email]> wrote:
Hi list,

I read in the documentation of Fuel that you can implement #fuelAccept: to prevent instances of a class from being serialized, but what I'd like is to ignore those instances, not to raise an error when trying to serialize them.

I tried with a visitSubstitution by nil, but it brought big trouble after serializing, materializing and trying to serialize again.


Hi Bernat. That should be the way I would do it. Which are the problems?


MyClass >> fuelAccept: aGeneralMapper
    ^ aGeneralMapper visitSubstitution: self by: nil

 
Thanks!

p.s. Using fuel 1.8.1 loaded from the latest configuration in ss3.

--
Bernat Romagosa.



--
Mariano
http://marianopeck.wordpress.com



--
Bernat Romagosa.