Here is the scenario:
case code
when 'www', '', nil
false
when 'code1', 'code2'... 'code_n' # The array STORE_CODES contains all the codes
true
else
false
end
How can I use STORE_CODES
directly after when
instead of 'code1', 'code2'... 'code_n'
just use:
when *STORE_CODES
instead of :
when 'code1', 'code2'... 'code_n'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With