Skip to content

Commit

Permalink
Fix RuboCop warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Feb 27, 2019
1 parent fef3ee1 commit 6485591
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/yard/handlers/c/handler_methods.rb
Expand Up @@ -68,7 +68,7 @@ def handle_method(scope, var_name, name, func_name, _source_file = nil)
register_visibility(obj, visibility)
find_method_body(obj, func_name)
obj.explicit = true
add_predicate_return_tag(name, obj) if name =~ /\?$/
add_predicate_return_tag(obj) if name =~ /\?$/
end
end

Expand Down
5 changes: 1 addition & 4 deletions lib/yard/handlers/common/method_handler.rb
Expand Up @@ -3,10 +3,8 @@
module YARD::Handlers
module Common
module MethodHandler

# @param [String] method_name
# @param [MethodObject] obj
def add_predicate_return_tag(method_name, 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?
Expand All @@ -15,7 +13,6 @@ def add_predicate_return_tag(method_name, obj)
end
end
end

end
end
end
2 changes: 1 addition & 1 deletion lib/yard/handlers/ruby/method_handler.rb
Expand Up @@ -41,7 +41,7 @@ class YARD::Handlers::Ruby::MethodHandler < YARD::Handlers::Ruby::Base
extended method_added method_removed method_undefined).include?(meth)
obj.add_tag(YARD::Tags::Tag.new(:private, nil))
elsif meth.to_s =~ /\?$/
add_predicate_return_tag(meth.to_s, obj)
add_predicate_return_tag(obj)
end

if obj.has_tag?(:option)
Expand Down

0 comments on commit 6485591

Please sign in to comment.