magic_help (FastRI::Util::MagicHelp)

    # File lib/fastri/util.rb, line 138
        def magic_help(query)
          if query =~ /\A(.*?)(#|::|\.)([^:#.]+)\Z/
            c, k, m = $1, $2, $3
            mid = m
            begin
              c = c.split(/::/).inject(Object){|s,x| s.const_get(x)}
              m = case k
                  when "#"
                    c.instance_method(m)
                  when "::"
                    c.method(m)
                  when "."
                    begin
                      # if it's a private_instance_method, assume it was created
                      # with module_function
                      if c.private_instance_methods.include?(m)
                        c.instance_method(m)
                      else
                        c.method(m)
                      end
                    rescue NameError
                      c.instance_method(m)
                    end
                  end

              ret = help_method_extract(m)
              if ret == 'Class#new' and
                  c.private_method_defined?(:initialize)
                return c.name + "::new"
              elsif ret =~ /^Kernel#/ and
                  Kernel.instance_methods(false).include? mid
                return "Object##{mid}"
              end
              ret
            rescue Exception
              query
            end
          else
            query
          end
        end