From: jmay Date: 2007-03-21T04:00:23+09:00 Subject: Defining my own class of unique objects Hi- I'm trying to define a class with semantics similar to Fixnum, where every object is unique. Each object has some internal state, more complex that a single numeric value. Also, I want this to work across marshalling and YAML.load. Semantics like this: Foo.new("stuff").object_id == Foo.new("stuff").object_id Foo.new("stuff").object_id == YAML.load(Foo.new("stuff").to_yaml).object_id I looked at Memoize, but this just memoizes results of method calls on instances, I couldn't figure out how to memoize #new. I'm stumped. Any suggestions? Thanks, -Jason