Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1226 from thomthom/dev-fix-double-return-tag
Fix double return tag.
- Loading branch information
Showing
5 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module YARD::Handlers | ||
module Common | ||
# Shared functionality between Ruby and C method handlers. | ||
module MethodHandler | ||
# @param [MethodObject] obj | ||
def add_predicate_return_tag(obj) | ||
if obj.tag(:return) && (obj.tag(:return).types || []).empty? | ||
obj.tag(:return).types = ['Boolean'] | ||
elsif obj.tag(:return).nil? | ||
unless obj.tags(:overload).any? {|overload| overload.tag(:return) } | ||
obj.add_tag(YARD::Tags::Tag.new(:return, "", "Boolean")) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters