lib/inch/code_object/provider/yard/object/base.rb in inch-0.3.1.rc3 vs lib/inch/code_object/provider/yard/object/base.rb in inch-0.3.1.rc4

- old
+ new

@@ -66,19 +66,13 @@ def docstring @docstring ||= Docstring.new(object.docstring) end # Returns all files declaring the object in the form of an Array of - # Arrays containing the filename and the line number of their - # declaration. + # Arrays containing the location of their declaration. # - # @example - # files # => [["lib/inch.rb", 3], - # ["lib/inch/cli.rb", 1], - # ["lib/inch/version.rb", 1], - # - # @return [Array<Array(String, Fixnum)>] + # @return [Array<CodeLocation>] def files object.files.map do |(filename, line_no)| CodeLocation.new(base_dir, filename, line_no) end rescue ::YARD::CodeObjects::ProxyMethodError @@ -200,12 +194,12 @@ def private_tag @__private_tag end - def private_api_tag? - api_tag && api_tag.text == 'private' + def tagged_as_internal_api? + private_api_tag? || docstring.describes_internal_api? end def protected? visibility == :protected end @@ -218,11 +212,11 @@ depth == 1 end # @return [Boolean] +true+ if the object has no documentation at all def undocumented? - docstring.empty? && tags.empty? + original_docstring.empty? end def unconsidered_tag_count unconsidered_tags.size end @@ -233,9 +227,17 @@ protected def multi_code_examples?(text) text.scan(/\b(#{Regexp.escape(name)})[^_0-9\!\?]/m).size > 1 + end + + def original_docstring + object.docstring.all + end + + def private_api_tag? + api_tag && api_tag.text == 'private' end def tag(name) tags(name).first end