New refactor with &. operator


Last version of rubocop start offence to something like safe navigation operator.
if start_date && start_date < start_of_month && end_date.nil?
# …
end
if start_date &.< start_of_month && end_date.nil?
# …
end
if (start_date &.< start_of_month) && end_date.nil?
# …
end
view raw and_operator.rb hosted with ❤ by GitHub
Now you can write it shorter.

(c) http://antulik.com/

Comments