lib/yard/handlers/ruby/legacy/method_handler.rb in yard-0.2.3.5 vs lib/yard/handlers/ruby/legacy/method_handler.rb in yard-0.4.0
- old
+ new
@@ -24,8 +24,18 @@
o.visibility = visibility
o.source = statement
o.explicit = true
o.parameters = args
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))
+ 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))
+ end
+
parse_block(:owner => obj) # mainly for yield/exceptions
end
end