Skip to content

Commit

Permalink
fixes incorrect error message for sample method
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed May 7, 2011
1 parent 3056b33 commit 6e83330
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +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
# [1,2,3,4,5,6].sample(-3) # => ArgumentError: negative array size
# [].sample # => nil
# [].sample(3) # => []
def sample(n=nil)
Expand Down

0 comments on commit 6e83330

Please sign in to comment.