Reputation: 59383
I have nothing useful to write about this function other than specifying what it outputs. If Yard doesn't find a description, it uses the contents of @return
instead. Is there any way to prevent that? I want to avoid silly duplication like you see in the example below.
##
# @return [Array<Hash>]
#
# an array of hashes. Example output:
#
# [
# {:name=>"FORNEBU", :municipality=>"BÆRUM", :county=>"AKERSHUS"},
# {:name=>"FORSAND", :municipality=>"FORSAND", :county=>"ROGALAND"}
# ]
#
Upvotes: 4
Views: 940
Reputation: 2397
you can use @example tag
##
# @return [Array<Hash>]
# @example
# an array of hashes. Example output:
#
# [
# {:name=>"FORNEBU", :municipality=>"BÆRUM", :county=>"AKERSHUS"},
# {:name=>"FORSAND", :municipality=>"FORSAND", :county=>"ROGALAND"}
# ]
#
and the method description will be like this:
#method_name(args) ⇒ Array<Hash>
Upvotes: 1