lib/yard/handlers/ruby/method_handler.rb in yard-0.4.0 vs lib/yard/handlers/ruby/method_handler.rb in yard-0.5.0
- old
+ new
@@ -25,14 +25,20 @@
end
if mscope == :instance && meth == "initialize"
unless obj.has_tag?(:return)
obj.docstring.add_tag(YARD::Tags::Tag.new(:return,
- "a new instance of +#{namespace.name}+", namespace.name.to_s))
+ "a new instance of #{namespace.name}", namespace.name.to_s))
end
elsif mscope == :class && obj.docstring.blank? && %w(inherited included
extended method_added method_removed method_undefined).include?(meth)
obj.docstring.add_tag(YARD::Tags::Tag.new(:private, nil))
+ elsif meth.to_s =~ /\?$/
+ if obj.tag(:return) && (obj.tag(:return).types || []).empty?
+ obj.tag(:return).types = ['Boolean']
+ elsif obj.tag(:return).nil?
+ obj.docstring.add_tag(YARD::Tags::Tag.new(:return, "", "Boolean"))
+ end
end
parse_block(blk, :owner => obj) # mainly for yield/exceptions
end
\ No newline at end of file