I have faced a different behavior with MRI/YARV.
Is this expected?
set up
class Foo
class << self
class << self
def foo; end
end
end
end
class Bar < Foo; end
Bar.singleton_class.foo
MRI/YARV
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
Bar.singleton_class.foo #=> nil
JRuby
jruby 1.7.0.preview2 (1.9.3p203) 2012-09-03 b37a0bd on Java HotSpot(TM) Server VM 1.7.0_07-b10 [linux-i386]
Bar.singleton_class.foo #=> NoMethodError: undefined method `foo' for #<Class:Bar>
I have faced a different behavior with MRI/YARV.
Is this expected?
set up
MRI/YARV
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
JRuby
jruby 1.7.0.preview2 (1.9.3p203) 2012-09-03 b37a0bd on Java HotSpot(TM) Server VM 1.7.0_07-b10 [linux-i386]