From d0279bf2e93c786363647f4453a2563508e28c5c Mon Sep 17 00:00:00 2001 From: Artem Darius Weber Date: Sat, 14 Dec 2024 13:40:55 +0300 Subject: [PATCH] feat: update valid_phone_number method to allow phone numbers with 9 to 15 digits --- .DS_Store | Bin 0 -> 6148 bytes lab2/contact.rb | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..bda1588039b15fafbfa2932f84fd4f781bf6e568 GIT binary patch literal 6148 zcmeHKyH3PF3>-s>Lo`<*%Kd_q;0u;huArcSk_N(+L08eIyU)2#gz*EEXhlnbY{{PN z+Otunh}QsQ`?0?P)&N#?MI1G>rg`sX!`_ z3j8Rb|A#_XtbvoG{W=)*`mXs-QH{@b^(U5C*TBh<8Jaki=v0XjLt=6er!!xpesXj= z#NNzv;>{8hip1a{#mXVoF=Hx_3M>^k_vKpq|Bn94{J$jSDiuft{*?mK^-uklpA@~d y`8e&hh5kbSHr84>gSBF!wPG%`6<^Qlias-611CqLbKmI1ya=c+X{o?pDDVXy{3X!< literal 0 HcmV?d00001 diff --git a/lab2/contact.rb b/lab2/contact.rb index 89cb1d5..ec032c0 100644 --- a/lab2/contact.rb +++ b/lab2/contact.rb @@ -10,8 +10,9 @@ class Contact def valid_phone_number? return true if @phone.nil? - - /\A\+?[0-9]{10,15}\z/.match?(@phone) + + # Разрешить от 9 до 15 цифр + /\A\+?[0-9]{9,15}\z/.match?(@phone) end def valid_telegram?