What do you think of the way ruby is written?

when I first got in touch with ruby, I saw that my colleague had this code when I was in review today:

provider = campaign_type == :entry ? Settings.pay_method_to_provider[pay_method] : self.auth_provider

it"s hard to understand at first glance.
what do you think?

Mar.18,2021

in general, when using the ternary operator, if the statement is long, you can write:

provider = if campaign_type == :entry
             Settings.pay_method_to_provider[pay_method]
           else 
             self.auth_provider
           end

but there are a lot of such one-line streams in Ruby code, so just get used to it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a71d-2c21a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a71d-2c21a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?