Closed necojackarc closed 8 years ago
A new feature, Style/EmptyCaseCondition, was introduced on the version 0.40.0.
Style/EmptyCaseCondition
Let’s get straight to the point, it doesn't allow us to write like this:
# NG def status case when active? :active when quitted? :quitted when banned? :banned when unconfirmed? :unconfirmed end end
Now, we need to adopt the following style:
# OK def status if active? :active elsif quitted? :quitted elsif banned? :banned elsif unconfirmed? :unconfirmed end end
I've been using the former because someone told me that many elsif looked a bit ugly and I agreed. You can find some similar opinions in the issue.
elsif
What do you think?
A new feature,
Style/EmptyCaseCondition
, was introduced on the version 0.40.0.Let’s get straight to the point, it doesn't allow us to write like this:
Now, we need to adopt the following style:
I've been using the former because someone told me that many
elsif
looked a bit ugly and I agreed. You can find some similar opinions in the issue.What do you think?