pub fn superclass(&'a self) -> Option<&'a RubyObject<'a>> {
        match *self {
            RubyObject::Module { ref superclass, .. } |
            RubyObject::Class { ref superclass, .. } |
            RubyObject::Metaclass { ref superclass, .. } => {
                let mut superclass = superclass;

                loop {
                    match superclass.get() {
                        None => return None,
                        Some(class@&RubyObject::Module { .. }) |
                        Some(class@&RubyObject::Class { .. }) |
                        Some(class@&RubyObject::Metaclass { .. }) => return Some(class),
                        Some(&RubyObject::IClass { superclass: ref superclass_, .. }) => superclass = superclass_,
                    }
                }
            },
            RubyObject::IClass { .. } =>
                panic!("should not get superclass of iclass directly"),
        }
    }
// returns the next module, class, or metaclass in the ancestry chain.
// skips iclasses.
returns the next module, class, or metaclass in the ancestry chain.
skips iclasses.
returns the next module class or metaclass in the ancestry chain . skips iclasses .
pub fn superclass(&'a self) -> Option<&'a RubyObject<'a>> {
        match *self {
            RubyObject::Module { ref superclass, .. } |
            RubyObject::Class { ref superclass, .. } |
            RubyObject::Metaclass { ref superclass, .. } => {
                let mut superclass = superclass;
                loop {
                    match superclass.get() {
                        None => return None,
                        Some(class@&RubyObject::Module { .. }) |
                        Some(class@&RubyObject::Class { .. }) |
                        Some(class@&RubyObject::Metaclass { .. }) => return Some(class),
                        Some(&RubyObject::IClass { superclass: ref superclass_, .. }) => superclass = superclass_,
                    }
                }
            },
            RubyObject::IClass { .. } =>
                panic!("should not get superclass of iclass directly"),
        }
    }
pub fn superclass ( & ' a self ) -> Option < & ' a RubyObject < ' a > > { match * self { RubyObject :: Module { ref superclass , .. } | RubyObject :: Class { ref superclass , .. } | RubyObject :: Metaclass { ref superclass , .. } => { let mut superclass = superclass ; loop { match superclass . get ( ) { None => return None , Some ( class @ & RubyObject :: Module { .. } ) | Some ( class @ & RubyObject :: Class { .. } ) | Some ( class @ & RubyObject :: Metaclass { .. } ) => return Some ( class ) , Some ( & RubyObject :: IClass { superclass : ref superclass_ , .. } ) => superclass = superclass_ , } } } , RubyObject :: IClass { .. } => panic ! ( " " ) , } }
returns the next module, class, or metaclass in the ancestry chain.
returns the next module class or metaclass in the ancestry chain .
&'a self