From: merch-redmine@... Date: 2017-12-23T05:07:53+00:00 Subject: [ruby-core:84413] [CommonRuby Feature#14224][Rejected] Boolean class Issue #14224 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Rejected This was already discussed and rejected in #12515. ---------------------------------------- Feature #14224: Boolean class https://bugs.ruby-lang.org/issues/14224#change-68604 * Author: sobrinho (Gabriel Sobrinho) * Status: Rejected * Priority: Normal * Assignee: * Target version: ---------------------------------------- Suggestion: TrueClass and FalseClass inheriting from Boolean (new superclass). This would make true/false checking easier, like: ``` unless value.is_a?(Boolean) raise "Non-boolean value" end ``` Currently we have to check for both classes: ``` unless value.is_a?(FalseClass) or value.is_a?(TrueClass) raise "Non-boolean value" end ``` In high-level APIs this would be beneficial, for example in RSpec: ``` expect(value).to be_a Boolean ``` Currently, we have to check like this: ``` expect([TrueClass, FalseClass]).to include value.class ``` Or another similar workaround. I would like to provide a patch if this is acceptable. -- https://bugs.ruby-lang.org/ Unsubscribe: