lib/yard/code_objects/proxy.rb in yard-0.4.0 vs lib/yard/code_objects/proxy.rb in yard-0.5.0
- old
+ new
@@ -73,11 +73,11 @@
# of the resolved object)
def path
if obj = to_obj
obj.path
else
- if @namespace == Registry.root
+ if @namespace.root?
(@imethod ? ISEP : "") + name.to_s
elsif @origname
if @origname =~ /^[A-Z]/
@origname
else
@@ -152,11 +152,11 @@
end
end
# Allows a parser to infer the type of the proxy by its path.
# @param [#to_sym] type the proxy's inferred type
- # @return [nil]
+ # @return [void]
def type=(type) Registry.proxy_types[path] = type.to_sym end
# @return [Boolean]
def instance_of?(klass)
self.class == klass
@@ -197,9 +197,12 @@
rescue NoMethodError
raise ProxyMethodError, "Proxy cannot call method ##{meth} on object '#{path}'"
end
end
end
+
+ # This class is never a root object
+ def root?; false end
private
# Attempts to find the object that this unresolved object
# references by checking if any objects by this name are