lib/yard/handlers/ruby/yield_handler.rb in yard-0.2.3.5 vs lib/yard/handlers/ruby/yield_handler.rb in yard-0.4.0

- old
+ new

@@ -5,11 +5,10 @@ return unless owner.is_a?(MethodObject) # Only methods yield return if owner.has_tag? :yield # Don't override yield tags return if owner.has_tag? :yieldparam # Same thing. yieldtag = YARD::Tags::Tag.new(:yield, "", []) - owner.docstring.add_tag(yieldtag) if statement.type == :yield statement.jump(:list).children.each do |item| if item == s(:var_ref, s(:kw, "self")) yieldtag.types << '_self' @@ -22,7 +21,9 @@ else yieldtag.types << item.source end end end + + owner.docstring.add_tag(yieldtag) unless yieldtag.types.empty? end end \ No newline at end of file