提交 91761b77 编写于 作者: S Sebastian Martinez

Added an example of exception situation on Array#sample docs

上级 4dd84c8d
......@@ -7,6 +7,7 @@ class Array
#
# [1,2,3,4,5,6].sample # => 4
# [1,2,3,4,5,6].sample(3) # => [2, 4, 5]
# [1,2,3,4,5,6].sample(-3) # => ArgumentError: negative sample number
# [].sample # => nil
# [].sample(3) # => []
def sample(n=nil)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册