lib/yard/lib/yard/serializers/file_system_serializer.rb
# Implements the serialized path of a code object.
#
# @param [CodeObjects::Base, CodeObjects::ExtraFileObject, String] object
#   the object to get a path for. The path of a string is the string itself.
# @return [String] if object is a String, returns
#   object, otherwise the path on disk (without the basepath).
Implements the serialized path of a code object.
Implements the serialized path of a code object .
def serialized_path(object)
        return object if object.is_a?(String)
        if object.is_a?(CodeObjects::ExtraFileObject)
          fspath = ['file.' + object.name + (extension.empty? ? '' : ".#{extension}")]
        else
          objname = object != YARD::Registry.root ? object.name.to_s : "top-level-namespace"
          objname += '_' + object.scope.to_s[0,1] if object.is_a?(CodeObjects::MethodObject)
          fspath = [objname + (extension.empty? ? '' : ".#{extension}")]
          if object.namespace && object.namespace.path != ""
            fspath.unshift(*object.namespace.path.split(CodeObjects::NSEP))
          end
        end
        File.join(encode_path_components(*fspath))
      end
def serialized_path ( object ) return object if object . is_a? ( String ) if object . is_a? ( CodeObjects :: ExtraFileObject ) fspath = [ 'file.' + object . name + ( extension . empty? ? '' : ".#{extension}" ) ] else objname = object != YARD :: Registry . root ? object . name . to_s : "top-level-namespace" objname += '_' + object . scope . to_s [ 0 , 1 ] if object . is_a? ( CodeObjects :: MethodObject ) fspath = [ objname + ( extension . empty? ? '' : ".#{extension}" ) ] if object . namespace && object . namespace . path != "" fspath . unshift ( * object . namespace . path . split ( CodeObjects :: NSEP ) ) end end File . join ( encode_path_components ( * fspath ) ) end
Implements the serialized path of a code object.
Implements the serialized path of a code object .
if object is a String, returns object, otherwise the path on disk (without the basepath).
if object is a String returns object otherwise the path on disk ( without the basepath ) .
String
object
object the object to get a path for. The path of a string is the string itself.
object the object to get a path for . The path of a string is the string itself .