From: Daniel Carrera Date: 2003-08-01T07:04:34+09:00 Subject: Re: Extracting a parent class Answer: a = b.class.superclass.new Why: b.class == B b.class.superclass == A b.class.superclass.new == A.new Cheers, Daniel. On Fri, Aug 01, 2003 at 06:53:01AM +0900, Michael Garriss wrote: > Sorry about the newbie question but.... > > class A > attr_accessor :a > end > > class B < A > attr_accessor :b > end > > b = B.new > b.a = "some data" > b.b = "some more data" > a = b.????? > > How do I set 'a' from 'b' so that a is of class A and not class B? I > don't want the extra info, I want just the subset of members found in > the parent class. Is there a way to cast? > > TIA > Michael Garriss > -- Daniel Carrera | PGP: 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88 Math PhD. UMD | http://www.math.umd.edu/~dcarrera/pgp.html * * * * * Weekly Smile * * * * * * * * * * * * * * * * * * * * * * * * Sign in a hotel in Athens: Visitors are expected to complain at the office between the hours of 9 and 11 A.M. daily. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *