123456789_123456789_123456789_123456789_123456789_

Module: YARD::Handlers::Common::MethodHandler

Overview

Shared functionality between ::YARD::Handlers::Ruby and ::YARD::Handlers::C method handlers.

Instance Method Summary

Instance Method Details

#add_predicate_return_tag(obj)

Parameters:

  • obj (MethodObject)
[ GitHub ]

  
# File 'lib/yard/handlers/common/method_handler.rb', line 8

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