From: dorianmariefr Date: 2021-11-13T18:41:52+00:00 Subject: [ruby-core:106041] [Ruby master Feature#18332] a ? b Issue #18332 has been reported by dorianmariefr (Dorian Mari��). ---------------------------------------- Feature #18332: a ? b https://bugs.ruby-lang.org/issues/18332 * Author: dorianmariefr (Dorian Mari��) * Status: Open * Priority: Normal ---------------------------------------- It would be a shortcut for `a ? b : nil`: e.g. ``` "#{current_path == "/" ? "font-bold"}" "#{user.admin? ? "text-red-600"}" ``` Doing `a && b` returns `false` which converted to a string gives `"false"`. When `nil` converts to a string it gives `""`. I would use it mostly in string interpolations. -- https://bugs.ruby-lang.org/ Unsubscribe: