Class is not equal to itself

  • Thread starter Dmitry V. Sabanin
  • Start date
D

Dmitry V. Sabanin

I'm having bad times with this odd problem here.
I have caching class, that recieves key and instance, caches it and
returns result. For some reason when instance of class Foo cached,
after it's return it no longer makes following statement true: Foo
=== instance. instance.class still gives me Foo class, but when i'm
trying to do Foo == instance.class I still get false.
My question is -- what can happen to a class so it would not longer be
able to recognize itself?
I'm not doing anything fancy within cache, just wrapping instance in
CacheInstance that returns it when asked.

Any help appreciated!
 
D

Dmitry V. Sabanin

Sorry to reply myself, but maybe that will help: when I'm trying to
Marshal::dump instance, it raises: "Foo can't be referred"
 
R

Robert Klemme

Dmitry V. Sabanin said:
Sorry to reply myself, but maybe that will help: when I'm trying to
Marshal::dump instance, it raises: "Foo can't be referred"

Then you need to make sure that Foo is actually defined when you do
Marshal.load(). Maybe you didn't require it in the loading script.

Works for me
=> true

Regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,921
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top