pub(crate) fn search_method(&self, method: IdentId) -> Option<DefinedMethod> {
        let mut class = *self;
        let mut singleton_flag = self.is_singleton();
        loop {
            match class.get_instance_method(method) {
                Some(method) => {
                    return Some(DefinedMethod::new(method, class));
                }
                None => match class.upper() {
                    Some(superclass) => class = superclass,
                    None => {
                        if singleton_flag {
                            singleton_flag = false;
                            class = self.class();
                        } else {
                            return None;
                        }
                    }
                },
            };
        }
    }
Get method for a receiver which class is `self` and `method` (IdentId) without using method cache.
Returns `FnId` and its owner `Module`.
ruruby/src/value/class.rs