考虑下面的ruby文件,foo.rb: # this is a module comment
module A
# this is a constant comment
B = 'hi'
# this is a class comment
class C
# this is a method comment
# @param [Stri
我有一个不纯的功能,像这样: # Impure function: Sets the status for a report_schedule, uses last_sent to
# calculate status
# @param report_schedule [Hash]
# @return [String] Non-useful: value of last_sent that
我有一个看起来像这样的方法: def get_endpoint(params: {})
end
我想这个方法的调用者能在几个可选的参数传递。 我想写YARD文档来支持这个,如果我没有使用关键字参数,我会使用@option声明。 然而,YARD自己的文档说: Note: For keyword parameters, use @param, not @option. 所以,我想: # @par
当试图创建我的围栏控制器的文档和使用的参数时,由于围场似乎期待,参数作为方法参数存在,所以我陷入困境。 # Renders a list of items
# @param params [Hash] the search parameters
# @option params [String] 'info' Only return items with this specific info