# File lib/yard/code_objects/method_object.rb, line 54
    def scope=(v)
      reregister = @scope ? true : false

      # handle module function
      if v == :module
        other = self.class.new(namespace, name)
        other.visibility = :private
        @visibility = :public
        @module_function = true
        @path = nil
      end

      YARD::Registry.delete(self)
      @path = nil
      @scope = v.to_sym
      if @scope == :module
        @scope = :class
      end
      YARD::Registry.register(self) if reregister
    end