From: "John-Mason P. Shackelford" Date: 2005-04-02T05:21:17+09:00 Subject: counter object / ++ lookalike Am I missing a part of the standard library that already does something like the following? class Counter < DelegateClass(Fixnum) def initialize __setobj__(0) end def inc __setobj__(__getobj__.next) self end end x = Counter.new # x == 0 x.inc # x == 1 x.inc.inc.inc # x == 4 Thanks, John-Mason Shackelford Software Developer Pearson Educational Measurement 2510 North Dodge St. Iowa City, IA 52245 ph. 319-354-9200x6214 john-mason.shackelford@pearson.com http://pearsonedmeasurement.com