#614 new
Sam Aaron

calling a 'class' method on an object's metaclass should invoke the class method of the object's class

Reported by Sam Aaron | June 22nd, 2008 @ 01:50 AM | in 1.0 preview

Try executing the attached file (created to aid my understanding of Ruby's object model). In Rubinius it fails at the following line:

puts "b_with_meta.metaclass.cheese: #{b_with_meta.metaclass.cheese}"

However, on all other versions of Ruby (MRI, JRuby, MacRuby, Ruby-1-9), the code executes completely and produces the following output:

A.cheese: edam

B.cheese: stilton

a.cheese: shropshire blue

b.cheese: cheddar

b_with_meta.cheese: cheshire

b_with_meta.metaclass.cheese: stilton

b_with_meta_meta.cheese: brie

b_with_meta_meta.metaclass.cheese: gouda

b_with_meta_meta.metaclass.metaclass.cheese: wensleydale

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Tags