From c59848cb948d72ab470f477b4cccdaa9bb8f8435 Mon Sep 17 00:00:00 2001 From: dcrawl Date: Wed, 25 Oct 2023 18:06:49 -0300 Subject: [PATCH] Update argumenterror.md --- docs/API/ruby/argumenterror.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/API/ruby/argumenterror.md b/docs/API/ruby/argumenterror.md index f736253..708b738 100644 --- a/docs/API/ruby/argumenterror.md +++ b/docs/API/ruby/argumenterror.md @@ -10,18 +10,26 @@ Raised when the arguments are wrong and there isn’t a more specific [Exception The following code: -> `[1, 2, 3].first(4, 5)` +```ruby + [1, 2, 3].first(4, 5) +``` will trigger this exception: -> `ArgumentError: wrong number of arguments (given 2, expected 1)` +``` + ArgumentError: wrong number of arguments (given 2, expected 1) +``` ## Example 2: Passing an argument that is not acceptable -> `[1, 2, 3].first(-4)` +```ruby + [1, 2, 3].first(-4) +``` the negative number being an invalid argument will trigger this response: -> `ArgumentError: negative array size` +``` + ArgumentError: negative array size +```