lib/yard/handlers/ruby/method_handler.rb in yard-0.2.3.5 vs lib/yard/handlers/ruby/method_handler.rb in yard-0.4.0
- old
+ new
@@ -20,9 +20,19 @@
o.visibility = visibility
o.source = statement.source
o.signature = method_signature(meth)
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(blk, :owner => obj) # mainly for yield/exceptions
end
\ No newline at end of file