From 2185f8fe2abf1ea4bc184dc614b84b466973f0a6 Mon Sep 17 00:00:00 2001 From: Amolith Date: Tue, 27 May 2025 13:56:03 -0600 Subject: [PATCH] refactor: set DeclinedError defaults to nil --- lib/credit_card_sale.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/credit_card_sale.rb b/lib/credit_card_sale.rb index 780efcc6cd9995ac318a5dca43455fc2528bd38b..89f9d0f914e635832e3797ecef8510177a3facf6 100644 --- a/lib/credit_card_sale.rb +++ b/lib/credit_card_sale.rb @@ -50,9 +50,9 @@ class DeclinedError < TransactionDeclinedError attr_reader :max_declines # Initializes a new DeclinedError. - # @param declines [Integer, nil] The current number of declines. - # @param max_declines [Integer, nil] The maximum allowed declines. - def initialize(declines, max_declines) + # @param declines [Integer, nil] (nil) The current number of declines. + # @param max_declines [Integer, nil] (nil) The maximum allowed declines. + def initialize(declines=nil, max_declines=nil) @declines = declines @max_declines = max_declines super("Transaction declined")