本文根据 Devhints / Tomdoc 翻译。代码示例及版本范围沿用原文。
Tomdoc
# Public: Duplicate some text an arbitrary number of times.
#
# text - The String to be duplicated.
# count - The Integer number of times to duplicate the text.
#
# Examples
#
# multiplex('Tom', 4)
# # => 'TomTomTomTom'
#
# Returns the duplicated String.
def multiplex(text, count)
text * count
end
参见 tomdoc.org.
标签
DeprecatedInternalPublic
选项
# options - The Hash options used to refine the selection (default: {}):
# :color - The String color to restrict by (optional).
# :weight - The Float weight to restrict by. The weight should
# be specified in grams (optional).
产出(Yields)
# Yields the Integer index of the iteration.
# Returns the duplicated String.
# Returns nothing.
# Raises Errno::ENOENT if the file can't be found.
# Returns something else and this is a wrapped
# multi-line comment.
签名
# Signature
#
# find_by_<field>[_and_<field>...](args)
#